pub struct ClientAttTable { /* private fields */ }Expand description
A compact, fixed-size map of client-specific attribute values (e.g. CCCDs).
Entries are stored in a flat byte buffer with a sorted index for binary-search lookups.
CLIENT_ATT_TABLE_SIZE determines the total storage available for both the index and values.
Implementations§
Source§impl ClientAttTable
impl ClientAttTable
Sourcepub const fn builder() -> ClientAttTableBuilder
pub const fn builder() -> ClientAttTableBuilder
Creates a new ClientAttTableBuilder for constructing a ClientAttTable.
Sourcepub const fn view(&self) -> ClientAttTableView<'_>
pub const fn view(&self) -> ClientAttTableView<'_>
Get a read-only view of the table
Sourcepub fn get(&self, key: u16) -> Option<&[u8]>
pub fn get(&self, key: u16) -> Option<&[u8]>
Returns a reference to the value associated with the given attribute handle, or None if not found.
Sourcepub fn write(
&mut self,
key: u16,
offset: usize,
data: &[u8],
) -> Result<(), AttErrorCode>
pub fn write( &mut self, key: u16, offset: usize, data: &[u8], ) -> Result<(), AttErrorCode>
Writes data to key starting at offset.
Sourcepub fn set_values(&mut self, src: &ClientAttTableView<'_>)
pub fn set_values(&mut self, src: &ClientAttTableView<'_>)
Copies values from src into this map for all matching keys.
Keys present in this map but not in src are zeroed. If value sizes differ,
only the smaller length is copied and the remainder is zeroed.
Trait Implementations§
Source§impl Clone for ClientAttTable
impl Clone for ClientAttTable
Source§fn clone(&self) -> ClientAttTable
fn clone(&self) -> ClientAttTable
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 moreSource§impl Debug for ClientAttTable
impl Debug for ClientAttTable
Auto Trait Implementations§
impl Freeze for ClientAttTable
impl RefUnwindSafe for ClientAttTable
impl Send for ClientAttTable
impl Sync for ClientAttTable
impl Unpin for ClientAttTable
impl UnwindSafe for ClientAttTable
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