Skip to main content

OsHandle

Struct OsHandle 

Source
pub struct OsHandle<T = DefaultHandle>(/* private fields */);
Expand description

A native operating system handle attachment.

Only compatible with the Builder Unix-socket constructors on Unix or named-pipe constructors on Windows. Serializing it over a generic byte stream fails the call with an error.

Implementations§

Source§

impl<T> OsHandle<T>

Source

pub fn new(value: T) -> Self

Wraps a native handle-like value for message attachment.

Source

pub fn into_inner(self) -> T

Returns the wrapped value.

§Panics

Panics if successful serialization already consumed the handle.

Trait Implementations§

Source§

impl<T> Debug for OsHandle<T>

Source§

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

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

impl<'de, T: From<OwnedFd>> Deserialize<'de> for OsHandle<T>

Available on Unix only.
Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T> From<T> for OsHandle<T>

Source§

fn from(value: T) -> Self

Converts to this type from the input type.
Source§

impl<T: AsFd + Into<OwnedFd>> Serialize for OsHandle<T>

Available on Unix only.
Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<T = OwnedFd> !Freeze for OsHandle<T>

§

impl<T = OwnedFd> !RefUnwindSafe for OsHandle<T>

§

impl<T = OwnedFd> !Sync for OsHandle<T>

§

impl<T> Send for OsHandle<T>
where Cell<Option<T>>: Send,

§

impl<T> Unpin for OsHandle<T>
where Cell<Option<T>>: Unpin,

§

impl<T> UnsafeUnpin for OsHandle<T>
where Cell<Option<T>>: UnsafeUnpin,

§

impl<T> UnwindSafe for OsHandle<T>
where Cell<Option<T>>: UnwindSafe,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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, 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.