pub struct TestControl { /* private fields */ }Implementations§
Source§impl TestControl
impl TestControl
pub fn unexpected_stop(&self, id: PeerId, error: Error)
pub fn is_started(&self, id: PeerId) -> bool
pub fn is_connected(&self, id: PeerId) -> bool
Trait Implementations§
Source§impl Clone for TestControl
impl Clone for TestControl
Source§fn clone(&self) -> TestControl
fn clone(&self) -> TestControl
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Control for TestControl
impl Control for TestControl
Source§fn start(
&mut self,
id: PeerId,
connection: Connection,
_codec: CodecId,
) -> Result<(), Error>
fn start( &mut self, id: PeerId, connection: Connection, _codec: CodecId, ) -> Result<(), Error>
Request to start sending audio to the peer. If the request succeeds
Ok(()) will be
returned, but audio may not be started until a ControlEvent::Started event is
produced in the events.Source§fn stop(&mut self, id: PeerId) -> Result<(), Error>
fn stop(&mut self, id: PeerId) -> Result<(), Error>
Request to stop the audio to a peer.
If the Audio is not started, an Err(Error::NotStarted) will be returned.
If the requests succeeds
Ok(()) will be returned but audio may not be stopped until a
ControlEvent::Stopped is produced in the events.Source§fn connect(&mut self, id: PeerId, supported_codecs: &[CodecId])
fn connect(&mut self, id: PeerId, supported_codecs: &[CodecId])
Send to indicate when connected to a peer.
supported_codecs indicates the set of codecs which are
communicated from the peer. Depending on the audio control implementation,
this may add a (stopped) media device. Audio control implementations can request audio be started
for peers that are connected.Source§fn disconnect(&mut self, id: PeerId)
fn disconnect(&mut self, id: PeerId)
Send to indicate that a peer has been disconnected. This shall tear down any audio path
set up for the peer and send a
ControlEvent::Stopped for each. This shall be idempotent
(calling disconnect on a disconnected PeerId does nothing)Source§fn take_events(&self) -> BoxStream<'static, ControlEvent>
fn take_events(&self) -> BoxStream<'static, ControlEvent>
Get a stream of the events produced by this audio control.
May panic if the event stream has already been taken.
Source§fn failed_request(&self, _request: ControlEvent, _error: Error)
fn failed_request(&self, _request: ControlEvent, _error: Error)
Respond with failure to a request from the event stream.
request should be the request that failed. If a request was not made by this audio
control the failure shall be ignored.Auto Trait Implementations§
impl Freeze for TestControl
impl !RefUnwindSafe for TestControl
impl Send for TestControl
impl Sync for TestControl
impl Unpin for TestControl
impl !UnwindSafe for TestControl
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [Self]§impl<T> IntoAny for T
impl<T> IntoAny for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more