pub struct AnyOrNone<A>(pub Option<A>);Expand description
Mainly used to generate types like (A, B)/() where OneOrNone would generate ((A, B))/(), but can also generate A/()
Tuple Fields§
§0: Option<A>Trait Implementations§
Source§impl<A: FromMersData> FromMersData for AnyOrNone<A>
impl<A: FromMersData> FromMersData for AnyOrNone<A>
fn as_type_from() -> Type
fn can_represent(t: &Type) -> bool
Source§fn try_represent<O, F: FnOnce(Option<Self>) -> O>(
d: &(impl MersData + ?Sized),
f: F,
) -> O
fn try_represent<O, F: FnOnce(Option<Self>) -> O>( d: &(impl MersData + ?Sized), f: F, ) -> O
NOTE:
f may only used the passed value of type Self during the call to f.
Storing the value anywhere, moving it to a thread or otherwise assuming that it lives longer than the function call
violates Rust’s lifetime rules, but is allowed by the compiler because of some unsafe code which
calls f with a Self type with a lifetime that is incorrect on purpose (but seemingly necessary for this to work at all).Source§impl<A: ToMersData> ToMersData for AnyOrNone<A>
impl<A: ToMersData> ToMersData for AnyOrNone<A>
Auto Trait Implementations§
impl<A> Freeze for AnyOrNone<A>where
A: Freeze,
impl<A> RefUnwindSafe for AnyOrNone<A>where
A: RefUnwindSafe,
impl<A> Send for AnyOrNone<A>where
A: Send,
impl<A> Sync for AnyOrNone<A>where
A: Sync,
impl<A> Unpin for AnyOrNone<A>where
A: Unpin,
impl<A> UnwindSafe for AnyOrNone<A>where
A: 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