pub struct SingletonRef<'a, T, L> { /* private fields */ }Expand description
A lightweight handle to a singleton that can be captured inside q!() closures.
Created via Singleton::by_ref(). When used
inside a q!() closure, resolves to a reference to the singleton’s value (&T) at runtime.
This type is Copy (required by q!() macro internals).
TODO(mingwei): https://github.com/hydro-project/stageleft/issues/73
Trait Implementations§
Source§impl<T, L> Clone for SingletonRef<'_, T, L>
impl<T, L> Clone for SingletonRef<'_, T, L>
Source§impl<'a, T: 'a, L> FreeVariableWithContextWithProps<L, ()> for SingletonRef<'a, T, L>where
L: Location<'a>,
impl<'a, T: 'a, L> FreeVariableWithContextWithProps<L, ()> for SingletonRef<'a, T, L>where
L: Location<'a>,
impl<T, L> Copy for SingletonRef<'_, T, L>
Auto Trait Implementations§
impl<'a, T, L> Freeze for SingletonRef<'a, T, L>
impl<'a, T, L> !RefUnwindSafe for SingletonRef<'a, T, L>
impl<'a, T, L> !Send for SingletonRef<'a, T, L>
impl<'a, T, L> !Sync for SingletonRef<'a, T, L>
impl<'a, T, L> Unpin for SingletonRef<'a, T, L>
impl<'a, T, L> UnsafeUnpin for SingletonRef<'a, T, L>
impl<'a, T, L> !UnwindSafe for SingletonRef<'a, T, L>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 moreCreates a shared type from an unshared type.