Skip to main content

Res

Struct Res 

Source
pub struct Res<'resources, T: ?Sized + 'static, Tag: 'static = DefaultResourceTag> { /* private fields */ }
Expand description

Shared view of one resource.

The resource type and optional tag identify the required capability in a command signature. Res is a transparent borrowing wrapper and allocates no memory.

Implementations§

Source§

impl<'resources, T, Tag> Res<'resources, T, Tag>
where T: ?Sized + 'static, Tag: 'static,

Source

pub const fn into_inner(self) -> &'resources T

Returns the wrapped shared reference.

Trait Implementations§

Source§

impl<T, Tag> Clone for Res<'_, T, Tag>
where T: ?Sized + 'static, Tag: 'static,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T, Tag> Copy for Res<'_, T, Tag>
where T: ?Sized + 'static, Tag: 'static,

Source§

impl<T, Tag> Debug for Res<'_, T, Tag>
where T: Debug + ?Sized + 'static, Tag: 'static,

Source§

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

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

impl<T, Tag> Deref for Res<'_, T, Tag>
where T: ?Sized + 'static, Tag: 'static,

Source§

type Target = T

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl<'param, R, T, Tag> SystemParam<R> for Res<'param, T, Tag>
where R: ResourceProvider<T, Tag>, T: 'static, Tag: 'static,

Source§

const ACCESS: ResourceAccess

Memory access performed by this parameter.
Source§

type Item<'resources> = Res<'resources, T, Tag>

Argument passed to the command for one resource-container lifetime.
Source§

unsafe fn fetch<'resources>( resources: *mut R, ) -> Result<Self::Item<'resources>, FetchError>

Extracts the command argument from resources. Read more

Auto Trait Implementations§

§

impl<'resources, T, Tag> Freeze for Res<'resources, T, Tag>
where &'resources T: Freeze, PhantomData<fn() -> Tag>: Freeze, T: ?Sized,

§

impl<'resources, T, Tag> RefUnwindSafe for Res<'resources, T, Tag>

§

impl<'resources, T, Tag> Send for Res<'resources, T, Tag>
where &'resources T: Send, PhantomData<fn() -> Tag>: Send, T: ?Sized,

§

impl<'resources, T, Tag> Sync for Res<'resources, T, Tag>
where &'resources T: Sync, PhantomData<fn() -> Tag>: Sync, T: ?Sized,

§

impl<'resources, T, Tag> Unpin for Res<'resources, T, Tag>
where &'resources T: Unpin, PhantomData<fn() -> Tag>: Unpin, T: ?Sized,

§

impl<'resources, T, Tag> UnsafeUnpin for Res<'resources, T, Tag>

§

impl<'resources, T, Tag> UnwindSafe for Res<'resources, T, Tag>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.