[][src]Struct dbus_message_parser::Decoder

pub struct Decoder<'a> { /* fields omitted */ }

Implementations

impl<'a> Decoder<'a>[src]

pub fn new(buf: &'a Bytes) -> Decoder<'a>[src]

pub fn with_offset(buf: &'a Bytes, offset: usize) -> Decoder[src]

pub fn with_fds(
    buf: &'a Bytes,
    offset: usize,
    fds: &'a [RawFd],
    offset_fds: usize
) -> Decoder<'a>
[src]

impl<'a> Decoder<'a>[src]

impl<'a> Decoder<'a>[src]

pub fn message(&mut self) -> DecodeResult<Message>[src]

Decode a byte array to a Message object.

Example

let msg = b"l\x02\x01\x01\n\0\0\0\x01\0\0\0=\0\0\0\x06\x01s\0\x05\0\0\0:1.98\0\0\0\x05\x01u\0\x01\0\0\0\x08\x01g\0\x01s\0\0\x07\x01s\0\x14\0\0\0org.freedesktop.DBus\0\0\0\0\x05\0\0\0:1.98\0";
let buf_read = Bytes::copy_from_slice(&msg[..]);
let mut decoder = Decoder::new(&buf_read);

if let Ok(msg) = decoder.message() {
    //...
}

impl<'a> Decoder<'a>[src]

pub fn byte(&mut self) -> DecodeResult<Value>[src]

Decode from a byte array at a specific offset to a Value::Byte.

pub fn boolean(&mut self, is_le: bool) -> DecodeResult<Value>[src]

Decode from a byte array at a specific offset to a Value::Boolean.

pub fn int_16(&mut self, is_le: bool) -> DecodeResult<Value>[src]

Decode from a byte array at a specific offset to a Value::Int16.

pub fn uint_16(&mut self, is_le: bool) -> DecodeResult<Value>[src]

Decode from a byte array at a specific offset to a Value::Uint16.

pub fn int_32(&mut self, is_le: bool) -> DecodeResult<Value>[src]

Decode from a byte array at a specific offset to a Value::Int32.

pub fn uint_32(&mut self, is_le: bool) -> DecodeResult<Value>[src]

Decode from a byte array at a specific offset to a Value::Uint32.

pub fn unix_fd(&mut self, is_le: bool) -> DecodeResult<Value>[src]

Decode from a byte array at a specific offset to a Value::UnixFD.

pub fn int_64(&mut self, is_le: bool) -> DecodeResult<Value>[src]

Decode from a byte array at a specific offset to a Value::Int64.

pub fn uint_64(&mut self, is_le: bool) -> DecodeResult<Value>[src]

Decode from a byte array at a specific offset to a Value::Uint64.

pub fn double(&mut self, is_le: bool) -> DecodeResult<Value>[src]

Decode from a byte array at a specific offset to a Value::Double.

pub fn string(&mut self, is_le: bool) -> DecodeResult<Value>[src]

Decode from a byte array at a specific offset to a Value::String.

pub fn path(&mut self, is_le: bool) -> DecodeResult<Value>[src]

Decode from a byte array at a specific offset to a Value::ObjectPath.

pub fn signature(&mut self) -> DecodeResult<Value>[src]

Decode from a byte array at a specific offset to a Value::Signature.

impl<'a> Decoder<'a>[src]

pub fn variant(&mut self, is_le: bool) -> DecodeResult<Value>[src]

Decode from a byte array at a specific offset to a Value::Variant.

pub fn array(
    &mut self,
    is_le: bool,
    array_recursion: u8,
    struct_recursion: u8,
    signature: &str
) -> DecodeResult<Value>
[src]

Decode from a byte array at a specific offset to a Value::Array.

pub fn decode_struct(
    &mut self,
    is_le: bool,
    array_recursion: u8,
    struct_recursion: u8,
    signature: &str
) -> DecodeResult<Value>
[src]

Decode from a byte array at a specific offset to a Value::Struct.

pub fn dict_entry(
    &mut self,
    is_le: bool,
    array_recursion: u8,
    struct_recursion: u8,
    signature_key: &str,
    signature_value: &str
) -> DecodeResult<Value>
[src]

Decode from a byte array at a specific offset to a Value::DictEntry.

impl<'a> Decoder<'a>[src]

pub fn value(&mut self, is_le: bool, sig: &str) -> DecodeResult<Vec<Value>>[src]

Decode a byte array to a Value object.

Auto Trait Implementations

impl<'a> RefUnwindSafe for Decoder<'a>

impl<'a> Send for Decoder<'a>

impl<'a> Sync for Decoder<'a>

impl<'a> Unpin for Decoder<'a>

impl<'a> UnwindSafe for Decoder<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.