pub trait Server: Sized {
type Event;
// Required method
fn on_write(
&self,
conn: &Connection,
handle: u16,
op: WriteOp,
offset: usize,
data: &[u8],
) -> Option<Self::Event>;
// Provided methods
fn on_deferred_read(
&self,
handle: u16,
offset: usize,
reply: DeferredReadReply,
) -> Option<Self::Event> { ... }
fn on_deferred_write(
&self,
handle: u16,
op: WriteOp,
offset: usize,
data: &[u8],
reply: DeferredWriteReply,
) -> Option<Self::Event> { ... }
fn on_notify_tx_complete(
&self,
conn: &Connection,
count: u8,
) -> Option<Self::Event> { ... }
fn on_indicate_confirm(
&self,
conn: &Connection,
handle: u16,
) -> Option<Self::Event> { ... }
fn on_services_changed_confirm(
&self,
conn: &Connection,
) -> Option<Self::Event> { ... }
fn on_timeout(&self, conn: &Connection) -> Option<Self::Event> { ... }
}
Required Associated Types§
Required Methods§
fn on_write( &self, conn: &Connection, handle: u16, op: WriteOp, offset: usize, data: &[u8], ) -> Option<Self::Event>
Provided Methods§
Sourcefn on_deferred_read(
&self,
handle: u16,
offset: usize,
reply: DeferredReadReply,
) -> Option<Self::Event>
fn on_deferred_read( &self, handle: u16, offset: usize, reply: DeferredReadReply, ) -> Option<Self::Event>
Handle reads of characteristics built with the
deferred_read
flag set.
Your Server must provide an implementation of this method if any of your characteristics has that flag set.
Sourcefn on_deferred_write(
&self,
handle: u16,
op: WriteOp,
offset: usize,
data: &[u8],
reply: DeferredWriteReply,
) -> Option<Self::Event>
fn on_deferred_write( &self, handle: u16, op: WriteOp, offset: usize, data: &[u8], reply: DeferredWriteReply, ) -> Option<Self::Event>
Handle writes of characteristics built with the
deferred_write
flag set.
Your Server must provide an implementation of this method if any of your characteristics has that flag set.
Sourcefn on_notify_tx_complete(
&self,
conn: &Connection,
count: u8,
) -> Option<Self::Event>
fn on_notify_tx_complete( &self, conn: &Connection, count: u8, ) -> Option<Self::Event>
Callback to indicate that one or more characteristic notifications have been transmitted.
Sourcefn on_indicate_confirm(
&self,
conn: &Connection,
handle: u16,
) -> Option<Self::Event>
fn on_indicate_confirm( &self, conn: &Connection, handle: u16, ) -> Option<Self::Event>
Callback to indicate that the indication of a characteristic has been received by the client.
Sourcefn on_services_changed_confirm(&self, conn: &Connection) -> Option<Self::Event>
fn on_services_changed_confirm(&self, conn: &Connection) -> Option<Self::Event>
Callback to indicate that the services changed indication has been received by the client.
fn on_timeout(&self, conn: &Connection) -> Option<Self::Event>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.