[−][src]Trait rubble::bytes::FromBytes
Trait for decoding values from a byte slice.
Required methods
fn from_bytes(bytes: &mut ByteReader<'a>) -> Result<Self, Error>
Decode a Self
from a byte slice, advancing bytes
to point past the data that was read.
If bytes
contains data not valid for the target type, or contains an insufficient number
of bytes, an error will be returned and the state of bytes
is unspecified (it can point to
arbitrary data).
Implementors
impl<'_> FromBytes<'_> for AttUuid
[src]
fn from_bytes(bytes: &mut ByteReader) -> Result<Self, Error>
[src]
impl<'_> FromBytes<'_> for AttHandle
[src]
fn from_bytes(bytes: &mut ByteReader) -> Result<Self, Error>
[src]
impl<'_> FromBytes<'_> for Channel
[src]
fn from_bytes(bytes: &mut ByteReader) -> Result<Self, Error>
[src]
impl<'_> FromBytes<'_> for ConnectRequestData
[src]
fn from_bytes(bytes: &mut ByteReader) -> Result<Self, Error>
[src]
impl<'_> FromBytes<'_> for Uuid
[src]
fn from_bytes(bytes: &mut ByteReader) -> Result<Self, Error>
[src]
impl<'_> FromBytes<'_> for Uuid16
[src]
fn from_bytes(bytes: &mut ByteReader) -> Result<Self, Error>
[src]
impl<'_> FromBytes<'_> for Uuid32
[src]
fn from_bytes(bytes: &mut ByteReader) -> Result<Self, Error>
[src]
impl<'a> FromBytes<'a> for &'a [u8]
[src]
fn from_bytes(bytes: &mut ByteReader<'a>) -> Result<Self, Error>
[src]
impl<'a> FromBytes<'a> for AdStructure<'a>
[src]
fn from_bytes(bytes: &mut ByteReader<'a>) -> Result<Self, Error>
[src]
impl<'a> FromBytes<'a> for Pdu<'a>
[src]
Decodes an advertising channel PDU (consisting of header and payload) from raw bytes.
fn from_bytes(bytes: &mut ByteReader<'a>) -> Result<Self, Error>
[src]
impl<'a> FromBytes<'a> for ControlPdu<'a>
[src]
fn from_bytes(bytes: &mut ByteReader<'a>) -> Result<Self, Error>
[src]
impl<'a> FromBytes<'a> for ByGroupAttData<'a>
[src]
fn from_bytes(bytes: &mut ByteReader<'a>) -> Result<Self, Error>
[src]
impl<'a> FromBytes<'a> for ByTypeAttData<'a>
[src]
fn from_bytes(bytes: &mut ByteReader<'a>) -> Result<Self, Error>
[src]
impl<'a> FromBytes<'a> for Header
[src]
fn from_bytes(bytes: &mut ByteReader<'a>) -> Result<Self, Error>
[src]
impl<'a> FromBytes<'a> for FeatureSet
[src]
fn from_bytes(bytes: &mut ByteReader<'a>) -> Result<Self, Error>
[src]
impl<'a> FromBytes<'a> for u8
[src]
fn from_bytes(bytes: &mut ByteReader<'a>) -> Result<Self, Error>
[src]
impl<'a, T: FromBytes<'a>> FromBytes<'a> for BytesOr<'a, T>
[src]
Creates a BytesOr
that stores bytes that can be decoded to a T
.
This will check that bytes
can indeed be decoded as a T
using its FromBytes
implementation, and returns an error if not.
The ByteReader
will be advanced to point past the decoded T
if the conversion succeeds.
fn from_bytes(bytes: &mut ByteReader<'a>) -> Result<Self, Error>
[src]
impl<'a, T: FromBytes<'a>> FromBytes<'a> for BytesOr<'a, [T]>
[src]
Creates a BytesOr
that stores bytes that can be decoded to a sequence of T
s.
This will check that bytes
can indeed be decoded as a sequence of T
s, and returns an error
if not. Note that this will read as many T
s as possible until the ByteReader
is at its
end of input. Any trailing data after the list of T
s will result in an error.
The ByteReader
will be advanced to point past the decoded list of T
s if the conversion
succeeds. In that case, it will be at EOF and no more data can be read.
fn from_bytes(bytes: &mut ByteReader<'a>) -> Result<Self, Error>
[src]
impl<'a, T: IsUuid> FromBytes<'a> for ServiceUuids<'a, T>
[src]
Decodes ServiceUuids
from a byte sequence containing:
TYPE
: The right "(In)complete List of N-bit Service Class UUIDs" type. Both the complete and incomplete type are accepted.UUID
...: n*2/4/16 Bytes of UUID data, in little endian.