serde_yml::libyml::util

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