pub struct Stream { /* private fields */ }
Expand description
Manages a local StreamEndpoint and its associated media task, starting and stopping the related media task in sync with the endpoint’s configured or streaming state. Note that this does not coordinate state with peer, which is done by bt_a2dp::Peer.
Implementations§
source§impl Stream
impl Stream
pub fn build( endpoint: StreamEndpoint, media_task_builder: Box<dyn MediaTaskBuilder>, ) -> Self
pub fn endpoint(&self) -> &StreamEndpoint
pub fn endpoint_mut(&mut self) -> &mut StreamEndpoint
pub fn configure( &mut self, peer_id: &PeerId, remote_id: &StreamEndpointId, capabilities: Vec<ServiceCapability>, ) -> Result<(), (ServiceCategory, ErrorCode)>
pub fn set_delay(&mut self, delay: Duration) -> Result<(), ErrorCode>
pub fn reconfigure( &mut self, capabilities: Vec<ServiceCapability>, ) -> Result<(), (ServiceCategory, ErrorCode)>
sourcepub fn start(
&mut self,
) -> Result<BoxFuture<'static, Result<(), Error>>, ErrorCode>
pub fn start( &mut self, ) -> Result<BoxFuture<'static, Result<(), Error>>, ErrorCode>
Attempt to start the endpoint. If the endpoint is successfully started, the media task is started and a future that will finish when the media task finishes is returned.
sourcepub fn release(&mut self, responder: SimpleResponder, peer: &Peer) -> Result<()>
pub fn release(&mut self, responder: SimpleResponder, peer: &Peer) -> Result<()>
Releases the endpoint and stops the processing of audio.
pub fn abort(&mut self)
pub async fn initiate_abort(&mut self, peer: &Peer)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Stream
impl !RefUnwindSafe for Stream
impl Send for Stream
impl !Sync for Stream
impl Unpin for Stream
impl !UnwindSafe for Stream
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more