Struct warmy::res::Res [−][src]
pub struct Res<T>(_);
Shareable resource type.
Resources are wrapped in this type. You cannot do much with an object of this type, despite borrowing immutable or mutably its content.
Methods
impl<T> Res<T>
[src]
impl<T> Res<T>
pub fn new(t: T) -> Self
[src]
pub fn new(t: T) -> Self
Wrap a value in a shareable resource.
pub fn borrow(&self) -> Ref<T>
[src]
pub fn borrow(&self) -> Ref<T>
Borrow a resource for as long as the return value lives.
pub fn borrow_mut(&self) -> RefMut<T>
[src]
pub fn borrow_mut(&self) -> RefMut<T>
Mutably borrow a resource for as long as the return value lives.
Trait Implementations
impl<T: Debug> Debug for Res<T>
[src]
impl<T: Debug> Debug for Res<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T> Clone for Res<T>
[src]
impl<T> Clone for Res<T>