pub enum GlobalProxy<I> {
NotPresent,
Bound(I),
}
Expand description
A helper for storing a bound global.
This helper is intended to simplify the implementation of RegistryHandler for state objects that cache a bound global.
Variants§
NotPresent
The requested global was not present after a complete enumeration.
Bound(I)
The cached global.
Implementations§
source§impl<I: Proxy> GlobalProxy<I>
impl<I: Proxy> GlobalProxy<I>
pub fn get(&self) -> Result<&I, GlobalError>
pub fn with_min_version(&self, min_version: u32) -> Result<&I, GlobalError>
Trait Implementations§
source§impl<I: Debug> Debug for GlobalProxy<I>
impl<I: Debug> Debug for GlobalProxy<I>
Auto Trait Implementations§
impl<I> RefUnwindSafe for GlobalProxy<I>where
I: RefUnwindSafe,
impl<I> Send for GlobalProxy<I>where
I: Send,
impl<I> Sync for GlobalProxy<I>where
I: Sync,
impl<I> Unpin for GlobalProxy<I>where
I: Unpin,
impl<I> UnwindSafe for GlobalProxy<I>where
I: 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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.