pub struct EachDataLoc<T> {
pub storage: T,
pub transient: T,
pub memory: T,
pub calldata: T,
}Expand description
Holds an instance of T for each data location.
Fields§
§storage: T§transient: T§memory: T§calldata: TImplementations§
Source§impl<T> EachDataLoc<T>
impl<T> EachDataLoc<T>
Sourcepub fn get(&self, loc: DataLocation) -> Twhere
T: Copy,
pub fn get(&self, loc: DataLocation) -> Twhere
T: Copy,
Gets a copy for the given data location.
Sourcepub fn get_ref(&self, loc: DataLocation) -> &T
pub fn get_ref(&self, loc: DataLocation) -> &T
Gets a reference for the given data location.
Sourcepub fn get_mut(&mut self, loc: DataLocation) -> &mut T
pub fn get_mut(&mut self, loc: DataLocation) -> &mut T
Gets a mutable reference for the given data location.
Trait Implementations§
Source§impl<T> Index<DataLocation> for EachDataLoc<T>
impl<T> Index<DataLocation> for EachDataLoc<T>
Source§fn index(
&self,
loc: DataLocation,
) -> &<EachDataLoc<T> as Index<DataLocation>>::Output
fn index( &self, loc: DataLocation, ) -> &<EachDataLoc<T> as Index<DataLocation>>::Output
Performs the indexing (
container[index]) operation. Read moreSource§impl<T> IndexMut<DataLocation> for EachDataLoc<T>
impl<T> IndexMut<DataLocation> for EachDataLoc<T>
Source§fn index_mut(
&mut self,
loc: DataLocation,
) -> &mut <EachDataLoc<T> as Index<DataLocation>>::Output
fn index_mut( &mut self, loc: DataLocation, ) -> &mut <EachDataLoc<T> as Index<DataLocation>>::Output
Performs the mutable indexing (
container[index]) operation. Read moreAuto Trait Implementations§
impl<T> Freeze for EachDataLoc<T>where
T: Freeze,
impl<T> RefUnwindSafe for EachDataLoc<T>where
T: RefUnwindSafe,
impl<T> Send for EachDataLoc<T>where
T: Send,
impl<T> Sync for EachDataLoc<T>where
T: Sync,
impl<T> Unpin for EachDataLoc<T>where
T: Unpin,
impl<T> UnwindSafe for EachDataLoc<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more