[−][src]Struct dbus_message_parser::Decoder
Implementations
impl<'a, T> Decoder<'a, T> where
T: Deref<Target = [u8]>, [src]
T: Deref<Target = [u8]>,
pub fn new(buf: &'a T) -> Decoder<'a, T>[src]
pub fn with_offset(buf: &'a T, offset: usize) -> Decoder<'a, T>[src]
pub fn with_fds(
buf: &'a T,
offset: usize,
fds: &'a [RawFd],
offset_fds: usize
) -> Decoder<'a, T>[src]
buf: &'a T,
offset: usize,
fds: &'a [RawFd],
offset_fds: usize
) -> Decoder<'a, T>
pub fn get_offset(&self) -> usize[src]
pub fn get_offset_fds(&self) -> usize[src]
impl<'a, T> Decoder<'a, T> where
T: Deref<Target = [u8]>, [src]
T: Deref<Target = [u8]>,
pub fn message_header(
&mut self
) -> DecodeResult<(MessageHeader, Option<(u32, String)>)>[src]
&mut self
) -> DecodeResult<(MessageHeader, Option<(u32, String)>)>
impl<'a, T> Decoder<'a, T> where
T: Deref<Target = [u8]>, [src]
T: Deref<Target = [u8]>,
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, T> Decoder<'a, T> where
T: Deref<Target = [u8]>, [src]
T: Deref<Target = [u8]>,
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, T> Decoder<'a, T> where
T: Deref<Target = [u8]>, [src]
T: Deref<Target = [u8]>,
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]
&mut self,
is_le: bool,
array_recursion: u8,
struct_recursion: u8,
signature: &str
) -> DecodeResult<Value>
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]
&mut self,
is_le: bool,
array_recursion: u8,
struct_recursion: u8,
signature: &str
) -> DecodeResult<Value>
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]
&mut self,
is_le: bool,
array_recursion: u8,
struct_recursion: u8,
signature_key: &str,
signature_value: &str
) -> DecodeResult<Value>
Decode from a byte array at a specific offset to a Value::DictEntry.
impl<'a, T> Decoder<'a, T> where
T: Deref<Target = [u8]>, [src]
T: Deref<Target = [u8]>,
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, T> RefUnwindSafe for Decoder<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T> Send for Decoder<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Sync for Decoder<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Unpin for Decoder<'a, T>
impl<'a, T> UnwindSafe for Decoder<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,