Skip to main content

DbusMessageEncoder

Struct DbusMessageEncoder 

Source
pub struct DbusMessageEncoder { /* private fields */ }
Expand description

Encoder for little-endian D-Bus wire protocol binary messages.

Implementations§

Source§

impl DbusMessageEncoder

Source

pub fn new() -> Self

Creates a new encoder with standard capacity.

Source

pub fn clear(&mut self)

Clears the internal buffer.

Source

pub fn as_bytes(&self) -> &[u8] ⓘ

Returns the encoded byte slice.

Source

pub fn pad_to(&mut self, alignment: usize)

Pads the buffer to the given byte alignment.

Source

pub fn push_u8(&mut self, val: u8)

Appends a raw byte.

Source

pub fn push_u16(&mut self, val: u16)

Appends a little-endian unsigned 16-bit integer.

Source

pub fn push_u32(&mut self, val: u32)

Appends a little-endian unsigned 32-bit integer.

Source

pub fn push_i32(&mut self, val: i32)

Appends a little-endian signed 32-bit integer.

Source

pub fn push_u64(&mut self, val: u64)

Appends a little-endian unsigned 64-bit integer.

Source

pub fn push_string(&mut self, val: &str)

Appends a D-Bus String (4-byte length + bytes + null terminator).

Source

pub fn push_object_path(&mut self, path: &str)

Appends a D-Bus ObjectPath (4-byte length + bytes + null terminator).

Source

pub fn push_signature(&mut self, sig: &str)

Appends a D-Bus Signature (1-byte length + bytes + null terminator).

Source

pub fn encode_method_call( &mut self, serial: u32, destination: Option<&str>, path: &str, interface: Option<&str>, member: &str, signature: Option<&str>, body: &[u8], )

Encodes a method call message with the given header fields and body data.

Source

pub fn encode_method_return( &mut self, serial: u32, reply_serial: u32, destination: Option<&str>, signature: Option<&str>, body: &[u8], )

Encodes a method return message in reply to a specific method call serial.

Trait Implementations§

Source§

impl Debug for DbusMessageEncoder

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for DbusMessageEncoder

Source§

fn default() -> Self

Returns the “default value” for a type. 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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoInitialState<T> for T

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,