pub struct WriteEvent<'stack, 'server, P: PacketPool> { /* private fields */ }
Expand description
A characteristic write event returned while processing GATT requests.
Implementations§
Source§impl<'stack, P: PacketPool> WriteEvent<'stack, '_, P>
impl<'stack, P: PacketPool> WriteEvent<'stack, '_, P>
Sourcepub fn value<T: FromGatt>(
&self,
_c: &Characteristic<T>,
) -> Result<T, FromGattError>
pub fn value<T: FromGatt>( &self, _c: &Characteristic<T>, ) -> Result<T, FromGattError>
Characteristic data to be written
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§
Source§impl<P: PacketPool> Drop for WriteEvent<'_, '_, P>
impl<P: PacketPool> Drop for WriteEvent<'_, '_, P>
Auto Trait Implementations§
impl<'stack, 'server, P> Freeze for WriteEvent<'stack, 'server, P>
impl<'stack, 'server, P> !RefUnwindSafe for WriteEvent<'stack, 'server, P>
impl<'stack, 'server, P> !Send for WriteEvent<'stack, 'server, P>
impl<'stack, 'server, P> !Sync for WriteEvent<'stack, 'server, P>
impl<'stack, 'server, P> Unpin for WriteEvent<'stack, 'server, P>
impl<'stack, 'server, P> !UnwindSafe for WriteEvent<'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