pub struct ScmSocket {
pub fd: i32,
pub blocking: bool,
}
Expand description
A unix socket specialized for file descriptor passing
Fields§
§fd: i32
§blocking: bool
Implementations§
source§impl ScmSocket
impl ScmSocket
sourcepub fn new(fd: i32) -> Result<ScmSocket, ScmSocketError>
pub fn new(fd: i32) -> Result<ScmSocket, ScmSocketError>
Create a blocking SCM socket from a raw file descriptor (unsafe)
sourcepub fn set_blocking(&mut self, blocking: bool) -> Result<(), ScmSocketError>
pub fn set_blocking(&mut self, blocking: bool) -> Result<(), ScmSocketError>
Use the standard library (unsafe) to set the socket to blocking / unblocking
sourcepub fn send_listeners(
&self,
listeners: &Listeners
) -> Result<(), ScmSocketError>
pub fn send_listeners( &self, listeners: &Listeners ) -> Result<(), ScmSocketError>
Send listeners (socket addresses and file descriptors) via an scm socket
sourcepub fn receive_listeners(&self) -> Result<Listeners, ScmSocketError>
pub fn receive_listeners(&self) -> Result<Listeners, ScmSocketError>
Receive and parse listeners (socket addresses and file descriptors) via an scm socket
Trait Implementations§
source§impl<'de> Deserialize<'de> for ScmSocket
impl<'de> Deserialize<'de> for ScmSocket
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<ScmSocket, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ScmSocket, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Serialize for ScmSocket
impl Serialize for ScmSocket
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ScmSocket
impl RefUnwindSafe for ScmSocket
impl Send for ScmSocket
impl Sync for ScmSocket
impl Unpin for ScmSocket
impl UnwindSafe for ScmSocket
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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