pub struct Db { /* private fields */ }Expand description
Read-only attribute database.
Describes the service structure, attribute permissions, and stores read-only values.
Implementations§
Source§impl Db
impl Db
Sourcepub fn iter(&self) -> impl Iterator<Item = (Handle, Uuid, &[u8])>
pub fn iter(&self) -> impl Iterator<Item = (Handle, Uuid, &[u8])>
Returns an iterator over all attributes in handle order.
Sourcepub fn get(&self, hdl: Handle) -> Option<(Uuid, &[u8])>
pub fn get(&self, hdl: Handle) -> Option<(Uuid, &[u8])>
Returns the type and value of the specified handle or None if the
handle is invalid. The value will be empty if it’s not part of the
database.
Sourcepub fn primary_services(
&self,
start: Handle,
uuid: Option<Uuid>,
) -> impl Iterator<Item = DbEntry<'_, ServiceDef>>
pub fn primary_services( &self, start: Handle, uuid: Option<Uuid>, ) -> impl Iterator<Item = DbEntry<'_, ServiceDef>>
Returns an iterator over primary services with optional UUID matching ([Vol 3] Part G, Section 4.4).
Sourcepub fn includes(
&self,
hdls: HandleRange,
) -> impl Iterator<Item = DbEntry<'_, IncludeDef>>
pub fn includes( &self, hdls: HandleRange, ) -> impl Iterator<Item = DbEntry<'_, IncludeDef>>
Returns an iterator over service includes ([Vol 3] Part G, Section 4.5.1).
Sourcepub fn characteristics(
&self,
hdls: HandleRange,
) -> impl Iterator<Item = DbEntry<'_, CharacteristicDef>>
pub fn characteristics( &self, hdls: HandleRange, ) -> impl Iterator<Item = DbEntry<'_, CharacteristicDef>>
Returns an iterator over service characteristics ([Vol 3] Part G, Section 4.6.1).
Sourcepub fn descriptors(
&self,
hdls: HandleRange,
) -> impl Iterator<Item = DbEntry<'_, DescriptorDef>>
pub fn descriptors( &self, hdls: HandleRange, ) -> impl Iterator<Item = DbEntry<'_, DescriptorDef>>
Returns an iterator over characteristic descriptors ([Vol 3] Part G, Section 4.7.1).
Sourcepub fn try_access(&self, req: Request, hdl: Handle) -> RspResult<Handle>
pub fn try_access(&self, req: Request, hdl: Handle) -> RspResult<Handle>
Performs read/write access permission check for a single handle.
Sourcepub fn try_multi_access<T: AsRef<[Handle]>>(
&self,
req: Request,
hdls: T,
) -> RspResult<T>
pub fn try_multi_access<T: AsRef<[Handle]>>( &self, req: Request, hdls: T, ) -> RspResult<T>
Performs read/write access permission check for multiple handles.
Sourcepub fn try_range_access(
&self,
req: Request,
hdls: HandleRange,
uuid: Uuid,
) -> RspResult<Vec<Handle>>
pub fn try_range_access( &self, req: Request, hdls: HandleRange, uuid: Uuid, ) -> RspResult<Vec<Handle>>
Performs read/write access permission check for a range of handles with UUID type matching.