pub struct Lens<'a, PointerBrand, S, T, A, B>where
PointerBrand: UnsizedCoercible,
S: 'a,
T: 'a,
A: 'a,
B: 'a,{ /* private fields */ }Expand description
A polymorphic lens for accessing and updating a field where types can change.
This matches PureScript’s Lens s t a b.
Uses FnBrand to support capturing closures.
§Type Parameters
'a: The lifetime of the values.PointerBrand: The reference-counted pointer type.S: The source type of the structure.T: The target type of the structure after an update.A: The source type of the focus.B: The target type of the focus after an update.
Implementations§
Source§impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> Lens<'a, PointerBrand, S, T, A, B>where
PointerBrand: UnsizedCoercible,
§Type Parameters
'a: The lifetime of the values.
PointerBrand: The reference-counted pointer type.
S: The source type of the structure.
T: The target type of the structure after an update.
A: The source type of the focus.
B: The target type of the focus after an update.
impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> Lens<'a, PointerBrand, S, T, A, B>where
PointerBrand: UnsizedCoercible,
§Type Parameters
'a: The lifetime of the values.PointerBrand: The reference-counted pointer type.S: The source type of the structure.T: The target type of the structure after an update.A: The source type of the focus.B: The target type of the focus after an update.
Sourcepub fn new(
to: impl 'a + Fn(S) -> (A, <FnBrand<PointerBrand> as CloneableFn>::Of<'a, B, T>),
) -> Self
pub fn new( to: impl 'a + Fn(S) -> (A, <FnBrand<PointerBrand> as CloneableFn>::Of<'a, B, T>), ) -> Self
Create a new polymorphic lens.
This matches PureScript’s lens' constructor.
§Type Signature
forall PointerBrand S T A B. UnsizedCoercible PointerBrand => (S -> (A, B -> T)) -> Lens PointerBrand S T A B
§Parameters
to: The getter/setter pair function.
§Returns
A new instance of the type.
§Examples
use fp_library::{
brands::{
FnBrand,
RcBrand,
RcFnBrand,
},
classes::CloneableFn,
types::optics::Lens,
};
let l: Lens<RcBrand, i32, String, i32, String> =
Lens::new(|x| (x, <FnBrand<RcBrand> as CloneableFn>::new(|s| s)));
assert_eq!(l.view(42), 42);Sourcepub fn from_view_set(
view: impl 'a + Fn(S) -> A,
set: impl 'a + Fn((S, B)) -> T,
) -> Selfwhere
S: Clone,
pub fn from_view_set(
view: impl 'a + Fn(S) -> A,
set: impl 'a + Fn((S, B)) -> T,
) -> Selfwhere
S: Clone,
Create a new polymorphic lens from a getter and setter.
§Type Signature
forall PointerBrand S T A B. UnsizedCoercible PointerBrand => (S -> A, (S, B) -> T) -> Lens PointerBrand S T A B
§Parameters
view: The getter function.set: The setter function.
§Returns
A new Lens instance.
§Examples
use fp_library::{
brands::RcBrand,
types::optics::Lens,
};
let l: Lens<RcBrand, i32, String, i32, String> = Lens::from_view_set(|x| x, |(_, s)| s);
assert_eq!(l.view(42), 42);Sourcepub fn view(&self, s: S) -> A
pub fn view(&self, s: S) -> A
View the focus of the lens in a structure.
§Type Signature
forall PointerBrand S T A B. UnsizedCoercible PointerBrand => (&Lens PointerBrand S T A B, S) -> A
§Parameters
&self: The lens instance.s: The structure to view.
§Returns
The focus value.
§Examples
use fp_library::{
brands::RcBrand,
types::optics::Lens,
};
let l: Lens<RcBrand, i32, i32, i32, i32> = Lens::from_view_set(|x| x, |(_, y)| y);
assert_eq!(l.view(10), 10);Sourcepub fn set(&self, s: S, b: B) -> T
pub fn set(&self, s: S, b: B) -> T
Set the focus of the lens in a structure.
§Type Signature
forall PointerBrand S T A B. UnsizedCoercible PointerBrand => (&Lens PointerBrand S T A B, S, B) -> T
§Parameters
&self: The lens instance.s: The structure to update.b: The new value for the focus.
§Returns
The updated structure.
§Examples
use fp_library::{
brands::RcBrand,
types::optics::Lens,
};
let l: Lens<RcBrand, i32, i32, i32, i32> = Lens::from_view_set(|x| x, |(_, y)| y);
assert_eq!(l.set(10, 20), 20);Trait Implementations§
Source§impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> AffineTraversalOptic<'a, S, T, A, B> for Lens<'a, PointerBrand, S, T, A, B>where
PointerBrand: UnsizedCoercible,
§Type Parameters
'a: The lifetime of the values.
PointerBrand: The reference-counted pointer type.
S: The source type of the structure.
T: The target type of the structure after an update.
A: The source type of the focus.
B: The target type of the focus after an update.
impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> AffineTraversalOptic<'a, S, T, A, B> for Lens<'a, PointerBrand, S, T, A, B>where
PointerBrand: UnsizedCoercible,
§Type Parameters
'a: The lifetime of the values.PointerBrand: The reference-counted pointer type.S: The source type of the structure.T: The target type of the structure after an update.A: The source type of the focus.B: The target type of the focus after an update.
Source§fn evaluate<Q: Strong + Choice>(
&self,
pab: <Q as Kind_266801a817966495>::Of<'a, A, B>,
) -> <Q as Kind_266801a817966495>::Of<'a, S, T>
fn evaluate<Q: Strong + Choice>( &self, pab: <Q as Kind_266801a817966495>::Of<'a, A, B>, ) -> <Q as Kind_266801a817966495>::Of<'a, S, T>
§Type Signature
forall PointerBrand S T A B Q. (Strong Q, Choice Q, UnsizedCoercible PointerBrand) => (&Lens PointerBrand S T A B, Q A B) -> Q S T
§Type Parameters
Q: The profunctor type.
§Parameters
&self: The lens instance.pab: The profunctor value to transform.
§Returns
The transformed profunctor value.
§Examples
use {
fp_library::{
brands::{
optics::*,
*,
},
classes::optics::*,
functions::*,
types::optics::*,
},
std::rc::Rc,
};
let l: Lens<RcBrand, (i32, String), (i32, String), i32, i32> =
Lens::from_view_set(|(x, _)| x, |((_, s), x)| (x, s));
let f = cloneable_fn_new::<RcFnBrand, _, _>(|x: i32| x * 2);
let modifier: Rc<dyn Fn((i32, String)) -> (i32, String)> =
AffineTraversalOptic::evaluate::<RcFnBrand>(&l, f);
assert_eq!(modifier((21, "hello".to_string())), (42, "hello".to_string()));Source§impl<'a, PointerBrand, S, T, A, B> Clone for Lens<'a, PointerBrand, S, T, A, B>where
PointerBrand: UnsizedCoercible,
S: 'a,
T: 'a,
A: 'a,
B: 'a,
§Type Parameters
'a: The lifetime of the values.
PointerBrand: The reference-counted pointer type.
S: The source type of the structure.
T: The target type of the structure after an update.
A: The source type of the focus.
B: The target type of the focus after an update.
impl<'a, PointerBrand, S, T, A, B> Clone for Lens<'a, PointerBrand, S, T, A, B>where
PointerBrand: UnsizedCoercible,
S: 'a,
T: 'a,
A: 'a,
B: 'a,
§Type Parameters
'a: The lifetime of the values.PointerBrand: The reference-counted pointer type.S: The source type of the structure.T: The target type of the structure after an update.A: The source type of the focus.B: The target type of the focus after an update.
Source§fn clone(&self) -> Self
fn clone(&self) -> Self
§Type Signature
forall PointerBrand S T A B. UnsizedCoercible PointerBrand => &Lens PointerBrand S T A B -> Lens PointerBrand S T A B
§Returns
A new Lens instance that is a copy of the original.
§Examples
use fp_library::{
brands::RcBrand,
types::optics::Lens,
};
let l: Lens<RcBrand, (i32, String), (i32, String), i32, i32> =
Lens::from_view_set(|(x, _)| x, |((_, s), x)| (x, s));
let cloned = l.clone();
assert_eq!(cloned.view((42, "hi".to_string())), 42);1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a, PointerBrand, S: 'a, A: 'a> FoldOptic<'a, S, A> for Lens<'a, PointerBrand, S, S, A, A>where
PointerBrand: UnsizedCoercible,
§Type Parameters
'a: The lifetime of the values.
PointerBrand: The reference-counted pointer type.
S: The source type of the structure.
A: The focus type.
impl<'a, PointerBrand, S: 'a, A: 'a> FoldOptic<'a, S, A> for Lens<'a, PointerBrand, S, S, A, A>where
PointerBrand: UnsizedCoercible,
§Type Parameters
'a: The lifetime of the values.PointerBrand: The reference-counted pointer type.S: The source type of the structure.A: The focus type.
Source§fn evaluate<R: 'a + Monoid + 'static, Q: UnsizedCoercible + 'static>(
&self,
pab: <ForgetBrand<Q, R> as Kind_266801a817966495>::Of<'a, A, A>,
) -> <ForgetBrand<Q, R> as Kind_266801a817966495>::Of<'a, S, S>
fn evaluate<R: 'a + Monoid + 'static, Q: UnsizedCoercible + 'static>( &self, pab: <ForgetBrand<Q, R> as Kind_266801a817966495>::Of<'a, A, A>, ) -> <ForgetBrand<Q, R> as Kind_266801a817966495>::Of<'a, S, S>
§Type Signature
forall PointerBrand S A R Q. (Monoid R, UnsizedCoercible Q, UnsizedCoercible PointerBrand) => (&Lens PointerBrand S A, Forget Q R A A) -> Forget Q R S S
§Type Parameters
R: The monoid type.Q: The reference-counted pointer type.
§Parameters
&self: The lens instance.pab: The profunctor value to transform.
§Returns
The transformed profunctor value.
§Examples
use fp_library::{
brands::{
optics::*,
*,
},
classes::optics::*,
functions::*,
types::optics::*,
};
let l: Lens<RcBrand, (i32, String), (i32, String), i32, i32> =
Lens::from_view_set(|(x, _)| x, |((_, s), x)| (x, s));
let f = Forget::<RcBrand, String, i32, i32>::new(|x| x.to_string());
let folded = FoldOptic::evaluate(&l, f);
assert_eq!(folded.run((42, "hi".to_string())), "42".to_string());Source§impl<'a, PointerBrand, S: 'a, A: 'a> GetterOptic<'a, S, A> for Lens<'a, PointerBrand, S, S, A, A>where
PointerBrand: UnsizedCoercible,
§Type Parameters
'a: The lifetime of the values.
PointerBrand: The reference-counted pointer type.
S: The source type of the structure.
A: The focus type.
impl<'a, PointerBrand, S: 'a, A: 'a> GetterOptic<'a, S, A> for Lens<'a, PointerBrand, S, S, A, A>where
PointerBrand: UnsizedCoercible,
§Type Parameters
'a: The lifetime of the values.PointerBrand: The reference-counted pointer type.S: The source type of the structure.A: The focus type.
Source§fn evaluate<R: 'a + 'static, Q: UnsizedCoercible + 'static>(
&self,
pab: <ForgetBrand<Q, R> as Kind_266801a817966495>::Of<'a, A, A>,
) -> <ForgetBrand<Q, R> as Kind_266801a817966495>::Of<'a, S, S>
fn evaluate<R: 'a + 'static, Q: UnsizedCoercible + 'static>( &self, pab: <ForgetBrand<Q, R> as Kind_266801a817966495>::Of<'a, A, A>, ) -> <ForgetBrand<Q, R> as Kind_266801a817966495>::Of<'a, S, S>
§Type Signature
forall PointerBrand S A R Q. (UnsizedCoercible Q, UnsizedCoercible PointerBrand) => (&Lens PointerBrand S A, Forget Q R A A) -> Forget Q R S S
§Type Parameters
R: The return type of the forget profunctor.Q: The reference-counted pointer type.
§Parameters
&self: The lens instance.pab: The profunctor value to transform.
§Returns
The transformed profunctor value.
§Examples
use fp_library::{
brands::{
optics::*,
*,
},
classes::optics::*,
functions::*,
types::optics::*,
};
let l: Lens<RcBrand, (i32, String), (i32, String), i32, i32> =
Lens::from_view_set(|(x, _)| x, |((_, s), x)| (x, s));
let f = Forget::<RcBrand, i32, i32, i32>::new(|x| x);
let folded = GetterOptic::evaluate(&l, f);
assert_eq!(folded.run((42, "hi".to_string())), 42);Source§impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> LensOptic<'a, S, T, A, B> for Lens<'a, PointerBrand, S, T, A, B>where
PointerBrand: UnsizedCoercible,
§Type Parameters
'a: The lifetime of the values.
PointerBrand: The reference-counted pointer type.
S: The source type of the structure.
T: The target type of the structure after an update.
A: The source type of the focus.
B: The target type of the focus after an update.
impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> LensOptic<'a, S, T, A, B> for Lens<'a, PointerBrand, S, T, A, B>where
PointerBrand: UnsizedCoercible,
§Type Parameters
'a: The lifetime of the values.PointerBrand: The reference-counted pointer type.S: The source type of the structure.T: The target type of the structure after an update.A: The source type of the focus.B: The target type of the focus after an update.
Source§fn evaluate<Q: Strong>(
&self,
pab: <Q as Kind_266801a817966495>::Of<'a, A, B>,
) -> <Q as Kind_266801a817966495>::Of<'a, S, T>
fn evaluate<Q: Strong>( &self, pab: <Q as Kind_266801a817966495>::Of<'a, A, B>, ) -> <Q as Kind_266801a817966495>::Of<'a, S, T>
§Type Signature
forall PointerBrand S T A B Q. (Strong Q, UnsizedCoercible PointerBrand) => (&Lens PointerBrand S T A B, Q A B) -> Q S T
§Type Parameters
Q: The profunctor type.
§Parameters
&self: The lens instance.pab: The profunctor value to transform.
§Returns
The transformed profunctor value.
§Examples
use {
fp_library::{
brands::{
optics::*,
*,
},
classes::optics::*,
functions::*,
types::optics::*,
},
std::rc::Rc,
};
let l: Lens<RcBrand, (i32, String), (i32, String), i32, i32> =
Lens::from_view_set(|(x, _)| x, |((_, s), x)| (x, s));
let f = cloneable_fn_new::<RcFnBrand, _, _>(|x: i32| x * 2);
let modifier: Rc<dyn Fn((i32, String)) -> (i32, String)> =
LensOptic::evaluate::<RcFnBrand>(&l, f);
assert_eq!(modifier((21, "hello".to_string())), (42, "hello".to_string()));Source§impl<'a, Q, PointerBrand, S, T, A, B> Optic<'a, Q, S, T, A, B> for Lens<'a, PointerBrand, S, T, A, B>where
Q: Strong,
PointerBrand: UnsizedCoercible,
S: 'a,
T: 'a,
A: 'a,
B: 'a,
§Type Parameters
'a: The lifetime of the values.
Q: The profunctor type.
PointerBrand: The reference-counted pointer type.
S: The source type of the structure.
T: The target type of the structure after an update.
A: The source type of the focus.
B: The target type of the focus after an update.
impl<'a, Q, PointerBrand, S, T, A, B> Optic<'a, Q, S, T, A, B> for Lens<'a, PointerBrand, S, T, A, B>where
Q: Strong,
PointerBrand: UnsizedCoercible,
S: 'a,
T: 'a,
A: 'a,
B: 'a,
§Type Parameters
'a: The lifetime of the values.Q: The profunctor type.PointerBrand: The reference-counted pointer type.S: The source type of the structure.T: The target type of the structure after an update.A: The source type of the focus.B: The target type of the focus after an update.
Source§fn evaluate(
&self,
pab: <Q as Kind_266801a817966495>::Of<'a, A, B>,
) -> <Q as Kind_266801a817966495>::Of<'a, S, T>
fn evaluate( &self, pab: <Q as Kind_266801a817966495>::Of<'a, A, B>, ) -> <Q as Kind_266801a817966495>::Of<'a, S, T>
§Type Signature
forall Q PointerBrand S T A B. (Strong Q, UnsizedCoercible PointerBrand) => (&Lens Q PointerBrand S T A B, Q A B) -> Q S T
§Parameters
&self: The lens instance.pab: The profunctor value to transform.
§Returns
The transformed profunctor value.
§Examples
use {
fp_library::{
brands::{
optics::*,
*,
},
classes::optics::*,
functions::*,
types::optics::*,
},
std::rc::Rc,
};
let l: Lens<RcBrand, (i32, String), (i32, String), i32, i32> =
Lens::from_view_set(|(x, _)| x, |((_, s), x)| (x, s));
let f = cloneable_fn_new::<RcFnBrand, _, _>(|x: i32| x * 2);
let modifier: Rc<dyn Fn((i32, String)) -> (i32, String)> =
Optic::<RcFnBrand, _, _, _, _>::evaluate(&l, f);
assert_eq!(modifier((21, "hello".to_string())), (42, "hello".to_string()));Source§impl<'a, Q, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> SetterOptic<'a, Q, S, T, A, B> for Lens<'a, PointerBrand, S, T, A, B>where
PointerBrand: UnsizedCoercible,
Q: UnsizedCoercible,
§Type Parameters
'a: The lifetime of the values.
Q: The reference-counted pointer type for the setter brand.
PointerBrand: The reference-counted pointer type for the lens.
S: The source type of the structure.
T: The target type of the structure after an update.
A: The source type of the focus.
B: The target type of the focus after an update.
impl<'a, Q, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> SetterOptic<'a, Q, S, T, A, B> for Lens<'a, PointerBrand, S, T, A, B>where
PointerBrand: UnsizedCoercible,
Q: UnsizedCoercible,
§Type Parameters
'a: The lifetime of the values.Q: The reference-counted pointer type for the setter brand.PointerBrand: The reference-counted pointer type for the lens.S: The source type of the structure.T: The target type of the structure after an update.A: The source type of the focus.B: The target type of the focus after an update.
Source§fn evaluate(
&self,
pab: <FnBrand<Q> as Kind_266801a817966495>::Of<'a, A, B>,
) -> <FnBrand<Q> as Kind_266801a817966495>::Of<'a, S, T>
fn evaluate( &self, pab: <FnBrand<Q> as Kind_266801a817966495>::Of<'a, A, B>, ) -> <FnBrand<Q> as Kind_266801a817966495>::Of<'a, S, T>
§Type Signature
forall Q PointerBrand S T A B. (UnsizedCoercible PointerBrand, UnsizedCoercible Q) => (&Lens Q PointerBrand S T A B, Fn Q A B) -> Fn Q S T
§Parameters
&self: The lens instance.pab: The profunctor value to transform.
§Returns
The transformed profunctor value.
§Examples
use {
fp_library::{
brands::{
optics::*,
*,
},
classes::optics::*,
functions::*,
types::optics::*,
},
std::rc::Rc,
};
let l: Lens<RcBrand, (i32, String), (i32, String), i32, i32> =
Lens::from_view_set(|(x, _)| x, |((_, s), x)| (x, s));
let f = cloneable_fn_new::<RcFnBrand, _, _>(|x: i32| x * 2);
let modifier: Rc<dyn Fn((i32, String)) -> (i32, String)> =
SetterOptic::<RcBrand, _, _, _, _>::evaluate(&l, f);
assert_eq!(modifier((21, "hello".to_string())), (42, "hello".to_string()));Source§impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> TraversalOptic<'a, S, T, A, B> for Lens<'a, PointerBrand, S, T, A, B>where
PointerBrand: UnsizedCoercible,
§Type Parameters
'a: The lifetime of the values.
PointerBrand: The reference-counted pointer type.
S: The source type of the structure.
T: The target type of the structure after an update.
A: The source type of the focus.
B: The target type of the focus after an update.
impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> TraversalOptic<'a, S, T, A, B> for Lens<'a, PointerBrand, S, T, A, B>where
PointerBrand: UnsizedCoercible,
§Type Parameters
'a: The lifetime of the values.PointerBrand: The reference-counted pointer type.S: The source type of the structure.T: The target type of the structure after an update.A: The source type of the focus.B: The target type of the focus after an update.
Source§fn evaluate<Q: Wander>(
&self,
pab: <Q as Kind_266801a817966495>::Of<'a, A, B>,
) -> <Q as Kind_266801a817966495>::Of<'a, S, T>
fn evaluate<Q: Wander>( &self, pab: <Q as Kind_266801a817966495>::Of<'a, A, B>, ) -> <Q as Kind_266801a817966495>::Of<'a, S, T>
§Type Signature
forall PointerBrand S T A B Q. (Wander Q, UnsizedCoercible PointerBrand) => (&Lens PointerBrand S T A B, Q A B) -> Q S T
§Type Parameters
Q: The profunctor type.
§Parameters
&self: The lens instance.pab: The profunctor value to transform.
§Returns
The transformed profunctor value.
§Examples
use {
fp_library::{
brands::{
optics::*,
*,
},
classes::optics::*,
functions::*,
types::optics::*,
},
std::rc::Rc,
};
let l: Lens<RcBrand, (i32, String), (i32, String), i32, i32> =
Lens::from_view_set(|(x, _)| x, |((_, s), x)| (x, s));
let f = cloneable_fn_new::<RcFnBrand, _, _>(|x: i32| x * 2);
let modifier: Rc<dyn Fn((i32, String)) -> (i32, String)> =
TraversalOptic::evaluate::<RcFnBrand>(&l, f);
assert_eq!(modifier((21, "hello".to_string())), (42, "hello".to_string()));Auto Trait Implementations§
impl<'a, PointerBrand, S, T, A, B> Freeze for Lens<'a, PointerBrand, S, T, A, B>where
<PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(S) -> (A, <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(B) -> T + 'a>) + 'a>: Freeze,
impl<'a, PointerBrand, S, T, A, B> RefUnwindSafe for Lens<'a, PointerBrand, S, T, A, B>where
<PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(S) -> (A, <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(B) -> T + 'a>) + 'a>: RefUnwindSafe,
impl<'a, PointerBrand, S, T, A, B> Send for Lens<'a, PointerBrand, S, T, A, B>where
<PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(S) -> (A, <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(B) -> T + 'a>) + 'a>: Send,
impl<'a, PointerBrand, S, T, A, B> Sync for Lens<'a, PointerBrand, S, T, A, B>where
<PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(S) -> (A, <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(B) -> T + 'a>) + 'a>: Sync,
impl<'a, PointerBrand, S, T, A, B> Unpin for Lens<'a, PointerBrand, S, T, A, B>where
<PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(S) -> (A, <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(B) -> T + 'a>) + 'a>: Unpin,
impl<'a, PointerBrand, S, T, A, B> UnsafeUnpin for Lens<'a, PointerBrand, S, T, A, B>where
<PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(S) -> (A, <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(B) -> T + 'a>) + 'a>: UnsafeUnpin,
impl<'a, PointerBrand, S, T, A, B> UnwindSafe for Lens<'a, PointerBrand, S, T, A, B>where
<PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(S) -> (A, <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(B) -> T + 'a>) + '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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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 more