pub struct Message {Show 13 fields
pub message_type: MessageType,
pub flags: u8,
pub serial: u32,
pub path: Option<String>,
pub interface: Option<String>,
pub member: Option<String>,
pub error_name: Option<String>,
pub reply_serial: Option<u32>,
pub destination: Option<String>,
pub sender: Option<String>,
pub body: Vec<Value>,
pub unix_fds: u32,
pub received_fds: Vec<RawFd>,
}Expand description
One D-Bus message.
Fields§
§message_type: MessageType§flags: u8§serial: u32§path: Option<String>§interface: Option<String>§member: Option<String>§error_name: Option<String>§reply_serial: Option<u32>§destination: Option<String>§sender: Option<String>§body: Vec<Value>§unix_fds: u32How many file descriptors travelled beside this message.
A h value in the body is an index into them, not a descriptor, and
they arrive out of band — see super::fds. Declared here so the
transport knows how many to claim for this message and no more.
received_fds: Vec<RawFd>File descriptors received alongside an inbound method call.
Profile APIs such as BlueZ Profile1.NewConnection pass an already
connected socket this way. The object handler owns these descriptors
and must either adopt or close them.
Implementations§
Source§impl Message
impl Message
Sourcepub fn call(
destination: &str,
path: &str,
interface: &str,
member: &str,
) -> Self
pub fn call( destination: &str, path: &str, interface: &str, member: &str, ) -> Self
A method call.
Sourcepub fn error_text(&self) -> Option<String>
pub fn error_text(&self) -> Option<String>
The text of an error reply.
Sourcepub fn framed_length(buf: &[u8]) -> Option<usize>
pub fn framed_length(buf: &[u8]) -> Option<usize>
How long a message starting at buf is, or None if the fixed header
has not arrived yet. Used to know how much more to read.
Sourcepub fn parse(buf: &[u8]) -> Result<Self, CodecError>
pub fn parse(buf: &[u8]) -> Result<Self, CodecError>
Decode one complete message.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Message
impl Freeze for Message
impl Move for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more