Struct tokio_dbus::SendBuf
source · pub struct SendBuf { /* private fields */ }
Expand description
Buffer used for sending messages through D-Bus.
Implementations§
source§impl SendBuf
impl SendBuf
sourcepub fn next_serial(&mut self) -> NonZeroU32
pub fn next_serial(&mut self) -> NonZeroU32
Get the next serial for this send buffer.
§Examples
use tokio_dbus::SendBuf;
let mut send = SendBuf::new();
assert_eq!(send.next_serial().get(), 1);
assert_eq!(send.next_serial().get(), 2);
sourcepub fn method_call<'a>(
&mut self,
path: &'a ObjectPath,
member: &'a str
) -> Message<'a>
pub fn method_call<'a>( &mut self, path: &'a ObjectPath, member: &'a str ) -> Message<'a>
Construct a method call Message
.
§Examples
use tokio_dbus::{Message, MessageBuf, ObjectPath, SendBuf};
const PATH: &ObjectPath = ObjectPath::new_const(b"/org/freedesktop/DBus");
let mut send = SendBuf::new();
let m = send.method_call(PATH, "Hello").to_owned();
let m2 = MessageBuf::method_call(PATH.into(), "Hello".into(), m.serial());
assert_eq!(m, m2);
sourcepub fn write_message(&mut self, message: Message<'_>) -> Result<()>
pub fn write_message(&mut self, message: Message<'_>) -> Result<()>
Write a message to the buffer.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for SendBuf
impl Send for SendBuf
impl Sync for SendBuf
impl Unpin for SendBuf
impl UnwindSafe for SendBuf
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