Struct rustable::gatt::server::Service[][src]

pub struct Service { /* fields omitted */ }

A GATT service that is to be added to an Application.

Implementations

impl Service[src]

pub fn new(uuid: UUID, primary: bool) -> Self[src]

Create new Service.

A non-primary services indicates that it is intended to be included by another service.

pub fn set_handle(&mut self, handle: Option<NonZeroU16>)[src]

Set the handle to requested by the service.

If this is not set then one will be requested from Bluez. Setting this can be useful because some remote devices (like Android devices) do not handle changing handles very well. When Application is finally registered, if the requested handles are not unique or they are already in use Bluez will reject the Application registration.

pub fn add_char(&mut self, character: Characteristic)[src]

pub fn includes(&self) -> &[UUID][src]

pub fn characteristics(&self) -> &[Characteristic][src]

pub fn add_includes(&mut self, service: UUID)[src]

pub fn remove_includes(&mut self, service: UUID)[src]

pub fn remove_char(&mut self, uuid: UUID) -> Option<Characteristic>[src]

pub fn uuid(&self) -> UUID[src]

Get the UUID of Service.

pub fn drain_chrcs(&mut self) -> Drain<'_, Characteristic>[src]

Removes all of the Characteristics in the service and returns then in an iterator.

Even if not all of the Characteristics are not consumed, they are still removed.

pub fn chrc_cnt(&self) -> usize[src]

Auto Trait Implementations

impl !RefUnwindSafe for Service

impl Send for Service

impl Sync for Service

impl Unpin for Service

impl !UnwindSafe for Service

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.