pub struct ReadEvent<'stack, 'server, P: PacketPool> { /* private fields */ }
Expand description
A characteristic read event returned while processing GATT requests.
Implementations§
Source§impl<'stack, P: PacketPool> ReadEvent<'stack, '_, P>
impl<'stack, P: PacketPool> ReadEvent<'stack, '_, P>
Sourcepub fn accept(self) -> Result<Reply<'stack, P>, Error>
pub fn accept(self) -> Result<Reply<'stack, P>, Error>
Accept the event, making it processed by the server.
Automatically called if drop() is invoked.
Sourcepub fn reject(self, err: AttErrorCode) -> Result<Reply<'stack, P>, Error>
pub fn reject(self, err: AttErrorCode) -> Result<Reply<'stack, P>, Error>
Reject the event with the provided error code, it will not be processed by the attribute server.
Sourcepub fn payload(&self) -> &GattData<'stack, P>
pub fn payload(&self) -> &GattData<'stack, P>
Get a reference to the underlying GattData
payload that this event is enclosing
Sourcepub fn into_payload(self) -> GattData<'stack, P>
pub fn into_payload(self) -> GattData<'stack, P>
Convert the event back into the GattData
payload it is enclosing
Allows for custom processing of the enclosed data, as in handling payloads which are not supported yet by the enclosed attribute server. Note that this will consume the event, so it would be up to the caller to respond to the incoming payload if needed and however they see fit.
Trait Implementations§
Auto Trait Implementations§
impl<'stack, 'server, P> Freeze for ReadEvent<'stack, 'server, P>
impl<'stack, 'server, P> !RefUnwindSafe for ReadEvent<'stack, 'server, P>
impl<'stack, 'server, P> !Send for ReadEvent<'stack, 'server, P>
impl<'stack, 'server, P> !Sync for ReadEvent<'stack, 'server, P>
impl<'stack, 'server, P> Unpin for ReadEvent<'stack, 'server, P>
impl<'stack, 'server, P> !UnwindSafe for ReadEvent<'stack, 'server, P>
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