pub struct ServiceDefinition { /* private fields */ }
Expand description
Defines a service to be added to a Server
Implementations§
Source§impl ServiceDefinition
impl ServiceDefinition
Sourcepub fn new(id: ServiceId, uuid: Uuid, kind: ServiceKind) -> Self
pub fn new(id: ServiceId, uuid: Uuid, kind: ServiceKind) -> Self
Make a new, empty service with a given id.
Sourcepub fn add_characteristic(
&mut self,
characteristic: Characteristic,
) -> Result<()>
pub fn add_characteristic( &mut self, characteristic: Characteristic, ) -> Result<()>
Add a characteristic to the definition. If any duplicate handles or an invalid configuration of descriptors are detected, an error is returned.
pub fn id(&self) -> ServiceId
pub fn uuid(&self) -> Uuid
pub fn kind(&self) -> ServiceKind
pub fn characteristics(&self) -> impl Iterator<Item = &Characteristic>
pub fn included(&self) -> impl Iterator<Item = ServiceId> + '_
Sourcepub fn add_service(&mut self, id: ServiceId)
pub fn add_service(&mut self, id: ServiceId)
Add a service to the definition.
Trait Implementations§
Source§impl Clone for ServiceDefinition
impl Clone for ServiceDefinition
Source§fn clone(&self) -> ServiceDefinition
fn clone(&self) -> ServiceDefinition
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 moreAuto Trait Implementations§
impl Freeze for ServiceDefinition
impl RefUnwindSafe for ServiceDefinition
impl Send for ServiceDefinition
impl Sync for ServiceDefinition
impl Unpin for ServiceDefinition
impl UnwindSafe for ServiceDefinition
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