Struct serde_yml::libyml::util::Owned

source ·
pub struct Owned<T, Init = T> { /* private fields */ }
Expand description

A struct representing ownership of a pointer to a value of type T. Init represents the initialization state of the value.

Implementations§

source§

impl<T> Owned<T>

source

pub fn new_uninit() -> Owned<MaybeUninit<T>, T>

Creates a new uninitialized Owned instance.

§Safety

The created instance contains uninitialized memory, and should be properly initialized before use.

source

pub unsafe fn assume_init(definitely_init: Owned<MaybeUninit<T>, T>) -> Owned<T>

Converts an uninitialized Owned instance to an initialized one.

§Safety

The caller must ensure that definitely_init is properly initialized.

Trait Implementations§

source§

impl<T: Debug, Init: Debug> Debug for Owned<T, Init>

source§

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

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

impl<T, Init> Deref for Owned<T, Init>

source§

fn deref(&self) -> &Self::Target

Returns a reference to the InitPtr wrapped by Owned.

source§

type Target = InitPtr<Init>

The resulting type after dereferencing.
source§

impl<T, Init> Drop for Owned<T, Init>

source§

fn drop(&mut self)

Deallocates the memory held by Owned when it goes out of scope.

Auto Trait Implementations§

§

impl<T, Init> Freeze for Owned<T, Init>

§

impl<T, Init> RefUnwindSafe for Owned<T, Init>
where T: RefUnwindSafe, Init: RefUnwindSafe,

§

impl<T, Init = T> !Send for Owned<T, Init>

§

impl<T, Init = T> !Sync for Owned<T, Init>

§

impl<T, Init> Unpin for Owned<T, Init>

§

impl<T, Init> UnwindSafe for Owned<T, Init>
where T: RefUnwindSafe, Init: 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,

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> 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 = Infallible

The type returned in the event of a conversion error.
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>,

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.