Struct kernel::list::ListArcField

source ·
pub struct ListArcField<T, const ID: u64 = 0> { /* private fields */ }
Expand description

A field owned by a specific ListArc.

Implementations§

source§

impl<T, const ID: u64> ListArcField<T, ID>

source

pub fn new(value: T) -> Self

Creates a new ListArcField.

source

pub fn get_mut(&mut self) -> &mut T

Access the value when we have exclusive access to the ListArcField.

This allows access to the field using an UniqueArc instead of a ListArc.

source

pub unsafe fn assert_ref(&self) -> &T

Unsafely assert that you have shared access to the ListArc for this field.

§Safety

The caller must have shared access to the ListArc<ID> containing the struct with this field for the duration of the returned reference.

source

pub unsafe fn assert_mut(&self) -> &mut T

Unsafely assert that you have mutable access to the ListArc for this field.

§Safety

The caller must have mutable access to the ListArc<ID> containing the struct with this field for the duration of the returned reference.

Trait Implementations§

source§

impl<T: Send + Sync, const ID: u64> Send for ListArcField<T, ID>

source§

impl<T: Send + Sync, const ID: u64> Sync for ListArcField<T, ID>

Auto Trait Implementations§

§

impl<T, const ID: u64 = 0> !Freeze for ListArcField<T, ID>

§

impl<T, const ID: u64 = 0> !RefUnwindSafe for ListArcField<T, ID>

§

impl<T, const ID: u64> Unpin for ListArcField<T, ID>
where T: Unpin,

§

impl<T, const ID: u64> UnwindSafe for ListArcField<T, ID>
where 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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, E> Init<T, E> for T

source§

unsafe fn __init(self, slot: *mut T) -> Result<(), E>

Initializes slot. Read more
source§

fn chain<F>(self, f: F) -> ChainInit<Self, F, T, E>
where F: FnOnce(&mut T) -> Result<(), E>,

First initializes the value using self then calls the function f with the initialized value. Read more
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, E> PinInit<T, E> for T

source§

unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), E>

Initializes slot. Read more
source§

fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>
where F: FnOnce(Pin<&mut T>) -> Result<(), E>,

First initializes the value using self then calls the function f with the initialized value. Read more
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.
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.
source§

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

Performs the conversion.