pub struct MessageWithFds {
pub message: JsonRpcMessage,
pub file_descriptors: Vec<OwnedFd>,
}Expand description
A JSON-RPC message paired with file descriptors to send or that were received.
Fields§
§message: JsonRpcMessageThe JSON-RPC message.
file_descriptors: Vec<OwnedFd>File descriptors attached to this message.
Implementations§
Source§impl MessageWithFds
impl MessageWithFds
Sourcepub fn new(message: JsonRpcMessage, file_descriptors: Vec<OwnedFd>) -> Self
pub fn new(message: JsonRpcMessage, file_descriptors: Vec<OwnedFd>) -> Self
Create a new message with file descriptors.
Sourcepub fn serialize(&self) -> Result<String>
pub fn serialize(&self) -> Result<String>
Serialize the message, setting the fds field to match the number of attached FDs.
Sourcepub fn serialize_pretty(&self) -> Result<String>
pub fn serialize_pretty(&self) -> Result<String>
Serialize the message with pretty-printing.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MessageWithFds
impl RefUnwindSafe for MessageWithFds
impl Send for MessageWithFds
impl Sync for MessageWithFds
impl Unpin for MessageWithFds
impl UnsafeUnpin for MessageWithFds
impl UnwindSafe for MessageWithFds
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