pub struct BtProfileComponent { /* private fields */ }Expand description
Represents a Bluetooth profile-under-test in the test topology.
Provides helpers designed to observe what the real profile implementation is doing.
Provides access to any capabilities that have been exposed by this profile.
Note: Only capabilities that are specified in the expose_capabilities field of the
PiconetHarness::add_profile_with_capabilities() method will be available for connection.
Implementations§
Source§impl BtProfileComponent
impl BtProfileComponent
pub fn new(stream: PeerObserverRequestStream, id: PeerId) -> Self
pub fn peer_id(&self) -> PeerId
Sourcepub fn connect_to_protocol<S: DiscoverableProtocolMarker>(
&self,
topology: &RealmInstance,
) -> Result<S::Proxy, Error>
pub fn connect_to_protocol<S: DiscoverableProtocolMarker>( &self, topology: &RealmInstance, ) -> Result<S::Proxy, Error>
Connects to the protocol S provided by this Profile. Returns the client end on success,
Error if the capability is not available.
Sourcepub async fn expect_observer_request(
&mut self,
) -> Result<PeerObserverRequest, Error>
pub async fn expect_observer_request( &mut self, ) -> Result<PeerObserverRequest, Error>
Expects a request over the PeerObserver protocol for this MockPeer.
Returns the request if successful.
Sourcepub async fn expect_observer_connection_request(
&mut self,
other: PeerId,
) -> Result<(), Error>
pub async fn expect_observer_connection_request( &mut self, other: PeerId, ) -> Result<(), Error>
Expects a connection request between the profile under test and the other peer.
Returns Ok on success, Error if there was no connection request on the observer or the request was for a different peer.
Sourcepub async fn expect_observer_service_found_request(
&mut self,
other: PeerId,
) -> Result<(), Error>
pub async fn expect_observer_service_found_request( &mut self, other: PeerId, ) -> Result<(), Error>
Expects the profile under test to discover the services of the other peer.
Returns Ok on success, Error if there was no ServiceFound request on the observer or the request was for a different peer.
Auto Trait Implementations§
impl Freeze for BtProfileComponent
impl !RefUnwindSafe for BtProfileComponent
impl Send for BtProfileComponent
impl Sync for BtProfileComponent
impl Unpin for BtProfileComponent
impl !UnwindSafe for BtProfileComponent
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
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
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>
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>
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