Struct FakeTypes

Source
pub struct FakeTypes {}

Trait Implementations§

Source§

impl Central<FakeTypes> for FakeCentral

Source§

fn scan(&self, _filters: &[ScanFilter]) -> ScannedResultStream

Scan for peers. If any of the filters match, the results will be returned in the Stream.
Source§

fn connect(&self, peer_id: PeerId) -> <FakeTypes as GattTypes>::ConnectFuture

Connect to a specific peer.
Source§

fn periodic_advertising( &self, ) -> Result<<FakeTypes as GattTypes>::PeriodicAdvertising>

Get API for periodic advertising.
Source§

impl Client<FakeTypes> for FakeClient

Source§

fn peer_id(&self) -> PeerId

The ID of the peer this is connected to.
Source§

fn find_service(&self, uuid: Uuid) -> <FakeTypes as GattTypes>::FindServicesFut

Find services by UUID on the peer. This may cause as much as a full discovery of all services on the peer if the stack deems it appropriate. Service information should be up to date at the time returned.
Source§

impl GattTypes for FakeTypes

Source§

type Central = FakeCentral

Source§

type ScanResultStream = ScannedResultStream

Source§

type Client = FakeClient

Source§

type ConnectFuture = Ready<Result<FakeClient, Error>>

Source§

type PeerServiceHandle = FakeServiceHandle

Source§

type FindServicesFut = Ready<Result<Vec<FakeServiceHandle>, Error>>

Source§

type PeerService = FakePeerService

Source§

type ServiceConnectFut = Ready<Result<FakePeerService, Error>>

Source§

type CharacteristicDiscoveryFut = Ready<Result<Vec<Characteristic>, Error>>

Future returned by PeerService::discover_characteristics, delivering the set of characteristics discovered within a service
Source§

type NotificationStream = UnboundedReceiver<Result<CharacteristicNotification, Error>>

A stream of notifications, delivering updates to a characteristic value that has been subscribed to. See client::PeerService::subscribe
Source§

type ReadFut<'a> = Ready<Result<(usize, bool), Error>>

Future resolving when a characteristic or descriptor has been read. Resolves to a number of bytes read along with a boolean indicating if the value was possibly truncated, or an Error if the value could not be read.
Source§

type WriteFut<'a> = Ready<Result<(), Error>>

Future resolving when a characteristic or descriptor has been written. Returns an error if the value could not be written.
Source§

type PeriodicAdvertising = FakePeriodicAdvertising

The implementation of periodic advertising for this GATT implementation.
Source§

impl LocalService<FakeTypes> for FakeLocalService

Source§

fn publish(&self) -> <FakeTypes as ServerTypes>::ServiceEventStream

Publish the service. Returns an EventStream providing Events to be processed by the local service implementation. Events will only be delivered to one ServiceEventStream at a time. Calling publish while a previous ServiceEventStream is still active will return a stream with only Err(AlreadyPublished).
Source§

fn notify(&self, characteristic: &Handle, data: &[u8], peers: &[PeerId])

Notify a characteristic. Leave peers empty to notify all peers who have configured notifications. Peers that have not configured for notifications will not be notified.
Source§

fn indicate( &self, characteristic: &Handle, data: &[u8], peers: &[PeerId], ) -> <FakeTypes as ServerTypes>::IndicateConfirmationStream

Indicate on a characteristic. Leave peers empty to notify all peers who have configured indications. Peers that have not configured for indications will be skipped. Returns a stream which has items for each peer that confirms the notification, and terminates when all peers have either timed out or confirmed.
Source§

impl PeerService<FakeTypes> for FakePeerService

Source§

fn discover_characteristics( &self, uuid: Option<Uuid>, ) -> <FakeTypes as GattTypes>::CharacteristicDiscoveryFut

Discover characteristics on this service. If uuid is provided, only the characteristics matching uuid will be returned. This operation may use either the Discovery All Characteristics of a Service or Discovery Characteristic by UUID procedures, regardless of uuid.
Source§

fn read_characteristic<'a>( &self, handle: &Handle, _offset: u16, buf: &'a mut [u8], ) -> <FakeTypes as GattTypes>::ReadFut<'a>

Read a characteristic into a buffer, given the handle within the service. On success, returns the size read and whether the value may have been truncated. By default this will try to use a long read if the buf is larger than a normal read will allow (22 bytes) or if the offset is non-zero.
Source§

fn write_characteristic<'a>( &self, handle: &Handle, _mode: WriteMode, _offset: u16, buf: &'a [u8], ) -> <FakeTypes as GattTypes>::WriteFut<'a>

Source§

fn read_descriptor<'a>( &self, _handle: &Handle, _offset: u16, _buf: &'a mut [u8], ) -> <FakeTypes as GattTypes>::ReadFut<'a>

Source§

fn write_descriptor<'a>( &self, _handle: &Handle, _offset: u16, _buf: &'a [u8], ) -> <FakeTypes as GattTypes>::WriteFut<'a>

Source§

fn subscribe( &self, handle: &Handle, ) -> <FakeTypes as GattTypes>::NotificationStream

Subscribe to updates on a Characteristic. Either notifications or indications will be enabled depending on the properties available, with indications preferred if they are supported. Fails if the Characteristic doesn’t support indications or notifications. Errors are delivered through an Err item in the stream. This will often write to the Client Characteristic Configuration descriptor for the Characteristic subscribed to. Updates sent from the peer will be delivered to the Stream returned.
Source§

impl PeerServiceHandle<FakeTypes> for FakeServiceHandle

Source§

impl Server<FakeTypes> for FakeServer

Source§

fn prepare( &self, service: ServiceDefinition, ) -> <FakeTypes as ServerTypes>::LocalServiceFut

Prepare to publish a service. This service is not immediately visible in the local GATT server. It will be published when the LocalService::publish is called. If the returned LocalService is dropped, the service will be removed from the Server.
Source§

impl ServerTypes for FakeTypes

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.