[][src]Trait rubble::bytes::ToBytes

pub trait ToBytes {
    fn to_bytes(&self, writer: &mut ByteWriter) -> Result<(), Error>;
}

Trait for encoding a value into a byte buffer.

Required methods

fn to_bytes(&self, writer: &mut ByteWriter) -> Result<(), Error>

Converts self to bytes and writes them into writer, advancing writer to point past the encoded value.

If writer does not contain enough space, an error will be returned and the state of the buffer is unspecified (eg. self may be partially written into writer).

Loading content...

Implementors

impl ToBytes for AttUuid[src]

impl ToBytes for Channel[src]

impl ToBytes for Header[src]

impl ToBytes for FeatureSet[src]

impl ToBytes for Uuid[src]

impl ToBytes for Uuid16[src]

impl ToBytes for Uuid32[src]

impl<'a> ToBytes for &'a [u8][src]

impl<'a> ToBytes for AdStructure<'a>[src]

fn to_bytes(&self, buf: &mut ByteWriter) -> Result<(), Error>[src]

Lowers this AD structure into a Byte buffer.

Returns the number of Bytes of buf that are used by this AD structure.

impl<'a> ToBytes for ControlPdu<'a>[src]

impl<'a> ToBytes for ByGroupAttData<'a>[src]

The ToBytes impl will truncate the value if it doesn't fit.

impl<'a> ToBytes for ByTypeAttData<'a>[src]

impl<'a, L: ToBytes> ToBytes for Pdu<'a, L>[src]

Serializes the payload of the PDU to bytes.

The PDU header must be constructed using Link-Layer state (and Pdu::llid).

impl<'a, T: ToBytes + ?Sized> ToBytes for BytesOr<'a, T>[src]

impl<'a, T: IsUuid> ToBytes for ServiceUuids<'a, T>[src]

impl<T: ToBytes> ToBytes for [T][src]

Loading content...