Enum ribir_algo::Resource
source · pub enum Resource<T> {
Share(ShareResource<T>),
Local(T),
}
Expand description
Enum to store both share and local resource. Share resources can have many copy, and every copy as the same one. Local resources means is individual and no other copy exist, two local resources will not as same one even its content is equal.
Variants§
Local(T)
Trait Implementations§
source§fn from(s: ShareResource<T>) -> Self
fn from(s: ShareResource<T>) -> Self
Converts to this type from the input type.
source§impl<T> PartialEq for Resource<T>
impl<T> PartialEq for Resource<T>
impl<T: Eq> Eq for Resource<T>
Auto Trait Implementations§
impl<T> Freeze for Resource<T>where
T: Freeze,
impl<T> RefUnwindSafe for Resource<T>where
T: RefUnwindSafe,
impl<T> !Send for Resource<T>
impl<T> !Sync for Resource<T>
impl<T> Unpin for Resource<T>where
T: Unpin,
impl<T> UnwindSafe for Resource<T>where
T: UnwindSafe + RefUnwindSafe,
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