[−][src]Enum resources::Entry
A view into an entry in a Resources
container, which may either be vacant or occupied.
This is returned by the entry
method on Resources
.
Variants
Occupied(OccupiedEntry<'a, T>)
An occupied entry.
Vacant(VacantEntry<'a, T>)
A vacant entry.
Implementations
impl<'a, T: Resource> Entry<'a, T>
[src]
pub fn or_insert(self, default: T) -> RefMut<'a, T>
[src]
Ensures a resource is in the entry by inserting the given value if empty, and returns a mutable reference to the contained resource.
pub fn or_insert_with(self, default: impl FnOnce() -> T) -> RefMut<'a, T>
[src]
Ensures a resource is in the entry by inserting the result of given function if empty, and returns a mutable reference to the contained resource.
pub fn and_modify(self, f: impl FnOnce(&mut T)) -> Self
[src]
Provides in-place mutable access to an occupied entry before any potential inserts.
impl<'a, T: Resource + Default> Entry<'a, T>
[src]
pub fn or_default(self) -> RefMut<'a, T>
[src]
Ensures a resource is in the entry by inserting it's default value if empty, and returns a mutable reference to the contained resource.
Auto Trait Implementations
impl<'a, T> !RefUnwindSafe for Entry<'a, T>
impl<'a, T> Send for Entry<'a, T>
impl<'a, T> Sync for Entry<'a, T>
impl<'a, T> Unpin for Entry<'a, T> where
T: Unpin,
T: Unpin,
impl<'a, T> !UnwindSafe for Entry<'a, T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
fn as_any(&self) -> &(dyn Any + 'static)
[src]
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,