# Struct rustix::io::epoll::Owning

source · [−]

    pub struct Owning<'context, T: Into<OwnedFd> + From<OwnedFd>> { /* private fields */ }

Expand description

A type implementing `Context` where the `Data` type is `T`, a type implementing `From<OwnedFd>` and `From<T> for OwnedFd`.

This may be used with `OwnedFd`, or higher-level types like `std::fs::File` or `std::net::TcpStream`.

## Implementations

source

### impl<'context, T: Into<OwnedFd> + From<OwnedFd>> Owning<'context, T>

source

#### pub fn new() -> Self

Creates a new empty `Owning`.

## Trait Implementations

source

### impl<'context, T: AsFd + Into<OwnedFd> + From<OwnedFd>> Context for Owning<'context, T>

#### type Data = T

The type of an element owned by this context.

#### type Target = BorrowedFd<'context>

The type of a value used to refer to an element owned by this context.

source

#### fn acquire<'call>(&self, data: Self::Data) -> Ref<'call, Self::Target>

Assume ownership of `data`, and returning a `Target`.

source

#### fn encode(&self, target: Ref<'_, Self::Target>) -> u64

Encode `target` as a `u64`. The only requirement on this value is that it be decodable by `decode`. Read more

source

#### unsafe fn decode<'call>(&self, raw: u64) -> Ref<'call, Self::Target>

Decode `raw`, which is a value encoded by `encode`, into a `Target`. Read more

source

#### fn release(&self, target: Ref<'_, Self::Target>) -> Self::Data

Release ownership of the value referred to by `target` and return it.

## Auto Trait Implementations

### impl<'context, T> RefUnwindSafe for Owning<'context, T> where
T: RefUnwindSafe,

### impl<'context, T> Send for Owning<'context, T> where
T: Sync,

### impl<'context, T> Sync for Owning<'context, T> where
T: Sync,

### impl<'context, T> Unpin for Owning<'context, T>

### impl<'context, T> UnwindSafe for Owning<'context, T> where
T: RefUnwindSafe,

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

const: unstable · source

#### fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more

source

### impl<T> BorrowMut<T> for T where
T: ?Sized,

const: unstable · source

#### fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more

source

### impl<T> From<T> for T

const: unstable · source

#### fn from(t: T) -> T

Returns the argument unchanged.

source

### impl<T, U> Into<U> for T where
U: From<T>,

const: unstable · 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>,

#### type Error = Infallible

The type returned in the event of a conversion error.

const: unstable · source

#### fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.

source

### impl<T, U> TryInto<U> for T where
U: TryFrom<T>,

#### type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

const: unstable · source

#### fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.