Skip to main content

Bearer

Struct Bearer 

Source
pub struct Bearer(/* private fields */);
Expand description

ATT bearer ([Vol 3] Part F, Section 3.2.11).

Implementations§

Source§

impl Bearer

Find information encoders ([Vol 3] Part F, Section 3.4.3).

Source

pub fn find_information_rsp( &self, start: Handle, it: impl Iterator<Item = (Handle, Uuid)>, ) -> RspResult<Rsp>

Returns an ATT_FIND_INFORMATION_RSP PDU ([Vol 3] Part F, Section 3.4.3.2).

Source

pub fn find_by_type_value_rsp( &self, start: Handle, it: impl Iterator<Item = (Handle, Option<Handle>)>, ) -> RspResult<Rsp>

Returns an ATT_FIND_BY_TYPE_VALUE_RSP PDU ([Vol 3] Part F, Section 3.4.3.4).

Source§

impl Bearer

Reading attributes encoders ([Vol 3] Part F, Section 3.4.4).

Source

pub fn read_by_type_rsp( &self, start: Handle, it: impl ValueIter<Handle>, ) -> RspResult<Rsp>

Returns an ATT_READ_BY_TYPE_RSP PDU ([Vol 3] Part F, Section 3.4.4.2).

Source

pub fn read_rsp(&self, v: &[u8]) -> RspResult<Rsp>

Returns an ATT_READ_RSP PDU ([Vol 3] Part F, Section 3.4.4.4).

Source

pub fn read_blob_rsp(&self, v: &[u8]) -> RspResult<Rsp>

Returns an ATT_READ_BLOB_RSP PDU ([Vol 3] Part F, Section 3.4.4.6).

Source

pub fn read_multiple_rsp<T>(&self, it: impl ValueIter<T>) -> RspResult<Rsp>

Returns an ATT_READ_MULTIPLE_RSP PDU ([Vol 3] Part F, Section 3.4.4.8).

Source

pub fn read_by_group_type_rsp( &self, start: Handle, it: impl ValueIter<HandleRange>, ) -> RspResult<Rsp>

Returns an ATT_READ_BY_GROUP_TYPE_RSP PDU ([Vol 3] Part F, Section 3.4.4.10).

Source

pub fn read_multiple_variable_rsp<T>( &self, it: impl ValueIter<T>, ) -> RspResult<Rsp>

Returns an ATT_READ_MULTIPLE_VARIABLE_RSP PDU ([Vol 3] Part F, Section 3.4.4.12).

Source§

impl Bearer

Writing attributes encoders ([Vol 3] Part F, Section 3.4.5).

Source

pub fn write_rsp(&self) -> RspResult<Rsp>

Returns an ATT_WRITE_RSP PDU ([Vol 3] Part F, Section 3.4.5.2).

Source§

impl Bearer

Queued writes encoders ([Vol 3] Part F, Section 3.4.6).

Source

pub fn prepare_write_rsp( &self, hdl: Handle, off: u16, v: &[u8], ) -> RspResult<Rsp>

Returns an ATT_PREPARE_WRITE_RSP PDU ([Vol 3] Part F, Section 3.4.6.2).

Source

pub fn execute_write_rsp(&self) -> RspResult<Rsp>

Returns an ATT_EXECUTE_WRITE_RSP PDU ([Vol 3] Part F, Section 3.4.6.4).

Source§

impl Bearer

Server initiated encoders ([Vol 3] Part F, Section 3.4.7).

Source

pub async fn handle_value_ntf(&mut self, hdl: Handle, v: &[u8]) -> Result<()>

Sends an ATT_HANDLE_VALUE_NTF PDU ([Vol 3] Part F, Section 3.4.7.1).

Source

pub async fn handle_value_ind(&mut self, hdl: Handle, v: &[u8]) -> Result<()>

Sends an ATT_HANDLE_VALUE_IND PDU and waits for the confirmation ([Vol 3] Part F, Section 3.4.7.2).

Source

pub async fn multiple_handle_value_ntf( &mut self, it: impl Iterator<Item = (Handle, &[u8])> + Send, ) -> Result<()>

Sends an ATT_MULTIPLE_HANDLE_VALUE_NTF PDU ([Vol 3] Part F, Section 3.4.7.4).

Source§

impl Bearer

Source

pub fn cid(&self) -> LeCid

Returns the channel ID.

Source

pub const fn mtu(&self) -> u16

Returns the current MTU.

Source

pub async fn recv(&mut self) -> Result<Pdu>

Returns the next command, request, notification, or indication PDU. This method is cancel safe.

Source

pub async fn send_rsp(&mut self, r: RspResult<Rsp>) -> Result<()>

Sends a response PDU or an ATT_ERROR_RSP if the request could not be completed ([Vol 3] Part F, Section 3.4.1.1). Command-related errors are ignored.

Trait Implementations§

Source§

impl Clone for Bearer

Source§

fn clone(&self) -> Bearer

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Bearer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more