pub struct FromUnit<A, B> { /* private fields */ }
Expand description
A Prism
to “inject” anything into ()
.
Implementations§
Trait Implementations§
Source§impl<A, B> Lenticuloid for FromUnit<A, B>
impl<A, B> Lenticuloid for FromUnit<A, B>
Source§impl<A, B> PartialLens for FromUnit<A, B>
impl<A, B> PartialLens for FromUnit<A, B>
fn try_get(&self, v: ()) -> Result<A, ()>
Source§fn try_get_inject(&self, v: ()) -> Result<(A, Injector<'_, B, ()>), ()>
fn try_get_inject(&self, v: ()) -> Result<(A, Injector<'_, B, ()>), ()>
This signature is somewhat hacky; it awaits resolution of the
FnBox
issue for better design. Notably, the injection function returned by
this method will (if law-abiding) only return Some
exactly once;
every time afterwards, it will return None
.fn set(&self, v: (), _x: B)
fn exchange(&self, _v: (), _x: B) -> (Option<A>, ())
fn modify<F>(&self, v: (), _f: F)where
F: FnOnce(A) -> B,
fn modify_with<F, X>(&self, _v: (), _f: F) -> ((), Option<X>)
impl<A, B> Copy for FromUnit<A, B>
Auto Trait Implementations§
impl<A, B> Freeze for FromUnit<A, B>
impl<A, B> !RefUnwindSafe for FromUnit<A, B>
impl<A, B> !Send for FromUnit<A, B>
impl<A, B> !Sync for FromUnit<A, B>
impl<A, B> !Unpin for FromUnit<A, B>
impl<A, B> !UnwindSafe for FromUnit<A, B>
Blanket Implementations§
Source§impl<This, Other> AndThenExt<Other> for Thiswhere
Other: Lenticuloid,
This: Lenticuloid<InitialTarget = <Other as Lenticuloid>::InitialSource, FinalTarget = <Other as Lenticuloid>::FinalSource>,
impl<This, Other> AndThenExt<Other> for Thiswhere
Other: Lenticuloid,
This: Lenticuloid<InitialTarget = <Other as Lenticuloid>::InitialSource, FinalTarget = <Other as Lenticuloid>::FinalSource>,
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