pub struct IndexedLens<'a, PointerBrand, I, S, T, A, B>where
PointerBrand: ToDynCloneFn,
I: 'a,
S: 'a,
T: 'a,
A: 'a,
B: 'a,{ /* private fields */ }Expand description
A polymorphic indexed lens.
§Type Parameters
'a: The lifetime of the values.PointerBrand: The reference-counted pointer type.I: The index 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, I: 'a, S: 'a, T: 'a, A: 'a, B: 'a> IndexedLens<'a, PointerBrand, I, S, T, A, B>where
PointerBrand: ToDynCloneFn,
§Type Parameters
'a: The lifetime of the values.
PointerBrand: The reference-counted pointer type.
I: The index 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, I: 'a, S: 'a, T: 'a, A: 'a, B: 'a> IndexedLens<'a, PointerBrand, I, S, T, A, B>where
PointerBrand: ToDynCloneFn,
§Type Parameters
'a: The lifetime of the values.PointerBrand: The reference-counted pointer type.I: The index 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) -> ((I, A), <FnBrand<PointerBrand> as CloneFn>::Of<'a, B, T>),
) -> Self
pub fn new( to: impl 'a + Fn(S) -> ((I, A), <FnBrand<PointerBrand> as CloneFn>::Of<'a, B, T>), ) -> Self
Create a new polymorphic indexed lens.
§Type Signature
forall PointerBrand I S T A B. ToDynCloneFn PointerBrand => (S -> ((I, A), Fn PointerBrand B T)) -> IndexedLens PointerBrand I S T A B
§Parameters
to: The getter/setter pair function.
§Returns
A new IndexedLens instance.
§Examples
use fp_library::{
brands::{
FnBrand,
RcBrand,
},
classes::*,
types::optics::IndexedLens,
};
let l: IndexedLens<RcBrand, usize, i32, String, i32, String> =
IndexedLens::new(|x| ((0, x), <FnBrand<RcBrand> as LiftFn>::new(|s| s)));
assert_eq!(l.iview(42), (0, 42));Sourcepub fn from_iview_set(
iview: impl 'a + Fn(S) -> (I, A),
set: impl 'a + Fn((S, B)) -> T,
) -> Selfwhere
S: Clone,
pub fn from_iview_set(
iview: impl 'a + Fn(S) -> (I, A),
set: impl 'a + Fn((S, B)) -> T,
) -> Selfwhere
S: Clone,
Create a new polymorphic indexed lens from an indexed getter and setter.
§Type Signature
forall PointerBrand I S T A B. ToDynCloneFn PointerBrand => (S -> (I, A), (S, B) -> T) -> IndexedLens PointerBrand I S T A B
§Parameters
iview: The indexed getter function.set: The setter function.
§Returns
A new IndexedLens instance.
§Examples
use fp_library::{
brands::RcBrand,
types::optics::IndexedLens,
};
let l: IndexedLens<RcBrand, usize, i32, String, i32, String> =
IndexedLens::from_iview_set(|(x)| (0, x), |(_, s)| s);
assert_eq!(l.iview(42), (0, 42));Sourcepub fn iview(&self, s: S) -> (I, A)
pub fn iview(&self, s: S) -> (I, A)
View the focus and its index.
§Type Signature
forall PointerBrand I S T A B. ToDynCloneFn PointerBrand => (&IndexedLens PointerBrand I S T A B, S) -> (I, A)
§Parameters
&self: The indexed lens instance.s: The structure to view.
§Returns
The focus value and its index.
§Examples
use fp_library::{
brands::RcBrand,
types::optics::IndexedLens,
};
let l: IndexedLens<RcBrand, usize, i32, i32, i32, i32> =
IndexedLens::from_iview_set(|x| (0, x), |(_, y)| y);
assert_eq!(l.iview(10), (0, 10));Sourcepub fn set(&self, s: S, b: B) -> T
pub fn set(&self, s: S, b: B) -> T
Set the focus.
§Type Signature
forall PointerBrand I S T A B. ToDynCloneFn PointerBrand => (&IndexedLens PointerBrand I S T A B, S, B) -> T
§Parameters
&self: The indexed lens instance.s: The structure to update.b: The new focus value.
§Returns
The updated structure.
§Examples
use fp_library::{
brands::RcBrand,
types::optics::IndexedLens,
};
let l: IndexedLens<RcBrand, usize, i32, i32, i32, i32> =
IndexedLens::from_iview_set(|x| (0, x), |(_, y)| y);
assert_eq!(l.set(10, 20), 20);Sourcepub fn over(&self, s: S, f: impl Fn(I, A) -> B) -> T
pub fn over(&self, s: S, f: impl Fn(I, A) -> B) -> T
Update the focus using an indexed function.
§Type Signature
forall PointerBrand I S T A B. ToDynCloneFn PointerBrand => (&IndexedLens PointerBrand I S T A B, S, (I, A) -> B) -> T
§Parameters
&self: The indexed lens instance.s: The structure to update.f: The function to apply to the focus.
§Returns
The updated structure.
§Examples
use fp_library::{
brands::RcBrand,
types::optics::IndexedLens,
};
let l: IndexedLens<RcBrand, usize, i32, i32, i32, i32> =
IndexedLens::from_iview_set(|x| (10, x), |(_, y)| y);
assert_eq!(l.over(10, |i, x| x + (i as i32)), 20);Trait Implementations§
Source§impl<'a, PointerBrand, I, S, T, A, B> Clone for IndexedLens<'a, PointerBrand, I, S, T, A, B>where
PointerBrand: ToDynCloneFn,
I: 'a,
S: 'a,
T: 'a,
A: 'a,
B: 'a,
§Type Parameters
'a: The lifetime of the values.
PointerBrand: The reference-counted pointer type.
I: The index 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, I, S, T, A, B> Clone for IndexedLens<'a, PointerBrand, I, S, T, A, B>where
PointerBrand: ToDynCloneFn,
I: 'a,
S: 'a,
T: 'a,
A: 'a,
B: 'a,
§Type Parameters
'a: The lifetime of the values.PointerBrand: The reference-counted pointer type.I: The index 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 I S T A B. ToDynCloneFn PointerBrand => &IndexedLens PointerBrand I S T A B -> IndexedLens PointerBrand I S T A B
§Returns
A new IndexedLens instance that is a copy of the original.
§Examples
use fp_library::{
brands::RcBrand,
types::optics::IndexedLens,
};
let l: IndexedLens<RcBrand, usize, (i32, String), (i32, String), i32, i32> =
IndexedLens::from_iview_set(|(x, _)| (0, x), |((_, s), x)| (x, s));
let cloned = l.clone();
assert_eq!(cloned.iview((42, "hi".to_string())), (0, 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, I: 'a, S: 'a, A: 'a> IndexedFoldOptic<'a, I, S, A> for IndexedLens<'a, PointerBrand, I, S, S, A, A>where
PointerBrand: ToDynCloneFn,
§Type Parameters
'a: The lifetime of the values.
PointerBrand: The reference-counted pointer type.
I: The index type.
S: The source type of the structure.
A: The source type of the focus.
impl<'a, PointerBrand, I: 'a, S: 'a, A: 'a> IndexedFoldOptic<'a, I, S, A> for IndexedLens<'a, PointerBrand, I, S, S, A, A>where
PointerBrand: ToDynCloneFn,
§Type Parameters
'a: The lifetime of the values.PointerBrand: The reference-counted pointer type.I: The index type.S: The source type of the structure.A: The source type of the focus.
Source§fn evaluate<R: 'a + Monoid + 'static, Q: ToDynCloneFn + 'static>(
&self,
pab: Indexed<'a, ForgetBrand<Q, R>, I, A, A>,
) -> <ForgetBrand<Q, R> as Kind_266801a817966495>::Of<'a, S, S>
fn evaluate<R: 'a + Monoid + 'static, Q: ToDynCloneFn + 'static>( &self, pab: Indexed<'a, ForgetBrand<Q, R>, I, A, A>, ) -> <ForgetBrand<Q, R> as Kind_266801a817966495>::Of<'a, S, S>
§Type Signature
forall PointerBrand I S A R Q. (Monoid R, ToDynCloneFn Q, ToDynCloneFn PointerBrand) => (&IndexedLens PointerBrand I S A, Indexed (Forget Q R) I A A) -> Forget Q R S S
§Type Parameters
R: The monoid type.Q: The reference-counted pointer type.
§Parameters
&self: The indexed lens instance.pab: The indexed profunctor value to transform.
§Returns
The transformed profunctor value.
§Examples
use fp_library::{
brands::{
optics::*,
*,
},
classes::optics::*,
types::optics::*,
};
let l: IndexedLens<RcBrand, usize, (i32, String), (i32, String), i32, i32> =
IndexedLens::from_iview_set(|(x, _)| (0, x), |((_, s), x)| (x, s));
let f = Forget::<RcBrand, String, (usize, i32), i32>::new(|(i, x)| format!("[{}]={}", i, x));
let pab = Indexed::new(f);
let result = IndexedFoldOptic::evaluate::<String, RcBrand>(&l, pab);
assert_eq!(result.run((42, "hi".to_string())), "[0]=42");Source§impl<'a, PointerBrand, I: 'a, S: 'a, A: 'a> IndexedGetterOptic<'a, I, S, A> for IndexedLens<'a, PointerBrand, I, S, S, A, A>where
PointerBrand: ToDynCloneFn,
§Type Parameters
'a: The lifetime of the values.
PointerBrand: The reference-counted pointer type.
I: The index type.
S: The source type of the structure.
A: The source type of the focus.
impl<'a, PointerBrand, I: 'a, S: 'a, A: 'a> IndexedGetterOptic<'a, I, S, A> for IndexedLens<'a, PointerBrand, I, S, S, A, A>where
PointerBrand: ToDynCloneFn,
§Type Parameters
'a: The lifetime of the values.PointerBrand: The reference-counted pointer type.I: The index type.S: The source type of the structure.A: The source type of the focus.
Source§fn evaluate<R: 'a + 'static, Q: ToDynCloneFn + 'static>(
&self,
pab: Indexed<'a, ForgetBrand<Q, R>, I, A, A>,
) -> <ForgetBrand<Q, R> as Kind_266801a817966495>::Of<'a, S, S>
fn evaluate<R: 'a + 'static, Q: ToDynCloneFn + 'static>( &self, pab: Indexed<'a, ForgetBrand<Q, R>, I, A, A>, ) -> <ForgetBrand<Q, R> as Kind_266801a817966495>::Of<'a, S, S>
§Type Signature
forall PointerBrand I S A R Q. (ToDynCloneFn Q, ToDynCloneFn PointerBrand) => (&IndexedLens PointerBrand I S A, Indexed (Forget Q R) I A A) -> Forget Q R S S
§Type Parameters
R: The result type.Q: The reference-counted pointer type.
§Parameters
&self: The indexed lens instance.pab: The indexed profunctor value to transform.
§Returns
The transformed profunctor value.
§Examples
use fp_library::{
brands::{
optics::*,
*,
},
classes::optics::*,
types::optics::*,
};
let l: IndexedLens<RcBrand, usize, (i32, String), (i32, String), i32, i32> =
IndexedLens::from_iview_set(|(x, _)| (0, x), |((_, s), x)| (x, s));
let f = Forget::<RcBrand, i32, (usize, i32), i32>::new(|(i, x)| x + (i as i32));
let pab = Indexed::new(f);
let result = IndexedGetterOptic::evaluate::<i32, RcBrand>(&l, pab);
assert_eq!(result.run((42, "hi".to_string())), 42);Source§impl<'a, PointerBrand, I: 'a, S: 'a, T: 'a, A: 'a, B: 'a> IndexedLensOptic<'a, I, S, T, A, B> for IndexedLens<'a, PointerBrand, I, S, T, A, B>where
PointerBrand: ToDynCloneFn,
§Type Parameters
'a: The lifetime of the values.
PointerBrand: The reference-counted pointer type.
I: The index 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, I: 'a, S: 'a, T: 'a, A: 'a, B: 'a> IndexedLensOptic<'a, I, S, T, A, B> for IndexedLens<'a, PointerBrand, I, S, T, A, B>where
PointerBrand: ToDynCloneFn,
§Type Parameters
'a: The lifetime of the values.PointerBrand: The reference-counted pointer type.I: The index 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: Indexed<'a, Q, I, A, B>,
) -> <Q as Kind_266801a817966495>::Of<'a, S, T>
fn evaluate<Q: Strong>( &self, pab: Indexed<'a, Q, I, A, B>, ) -> <Q as Kind_266801a817966495>::Of<'a, S, T>
§Type Signature
forall PointerBrand I S T A B Q. (Strong Q, ToDynCloneFn PointerBrand) => (&IndexedLens PointerBrand I S T A B, Indexed Q I A B) -> Q S T
§Type Parameters
Q: The profunctor type.
§Parameters
&self: The indexed lens instance.pab: The indexed profunctor value to transform.
§Returns
The transformed profunctor value.
§Examples
use fp_library::{
brands::{
optics::*,
*,
},
classes::optics::*,
types::optics::*,
};
let l: IndexedLens<RcBrand, usize, (i32, String), (i32, String), i32, i32> =
IndexedLens::from_iview_set(|(x, _)| (0, x), |((_, s), x)| (x, s));
let f = std::rc::Rc::new(|(i, x): (usize, i32)| x + (i as i32))
as std::rc::Rc<dyn Fn((usize, i32)) -> i32>;
let pab = Indexed::<RcFnBrand, _, _, _>::new(f);
let result: std::rc::Rc<dyn Fn((i32, String)) -> (i32, String)> =
IndexedLensOptic::evaluate::<RcFnBrand>(&l, pab);
assert_eq!(result((42, "hi".to_string())), (42, "hi".to_string()));Source§impl<'a, P: Strong, I: 'a, S: 'a, T: 'a, A: 'a, B: 'a, PointerBrand> IndexedOpticAdapter<'a, P, I, S, T, A, B> for IndexedLens<'a, PointerBrand, I, S, T, A, B>where
PointerBrand: ToDynCloneFn,
§Type Parameters
'a: The lifetime of the values.
P: The profunctor type.
I: The index 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.
PointerBrand: The reference-counted pointer type for the lens.
impl<'a, P: Strong, I: 'a, S: 'a, T: 'a, A: 'a, B: 'a, PointerBrand> IndexedOpticAdapter<'a, P, I, S, T, A, B> for IndexedLens<'a, PointerBrand, I, S, T, A, B>where
PointerBrand: ToDynCloneFn,
§Type Parameters
'a: The lifetime of the values.P: The profunctor type.I: The index 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.PointerBrand: The reference-counted pointer type for the lens.
Source§fn evaluate_indexed(
&self,
pab: Indexed<'a, P, I, A, B>,
) -> <P as Kind_266801a817966495>::Of<'a, S, T>
fn evaluate_indexed( &self, pab: Indexed<'a, P, I, A, B>, ) -> <P as Kind_266801a817966495>::Of<'a, S, T>
§Type Signature
forall P I S T A B PointerBrand. (Strong P, ToDynCloneFn PointerBrand) => (&IndexedLens P I S T A B PointerBrand, Indexed P I A B) -> P S T
§Parameters
&self: The indexed lens instance.pab: The indexed profunctor value.
§Returns
The transformed profunctor value.
§Examples
use fp_library::{
brands::{
RcBrand,
RcFnBrand,
optics::*,
},
functions::*,
types::optics::*,
};
let l: IndexedLensPrime<RcBrand, usize, (i32, String), i32> =
IndexedLensPrime::from_iview_set(|(x, _)| (0, x), |((_, s), x)| (x, s));
let result = optics_indexed_view::<RcBrand, _, _, _>(&l, (42, "hi".to_string()));
assert_eq!(result, (0, 42));Source§impl<'a, P: Strong, I: 'a, S: 'a, T: 'a, A: 'a, B: 'a, PointerBrand> IndexedOpticAdapterDiscardsFocus<'a, P, I, S, T, A, B> for IndexedLens<'a, PointerBrand, I, S, T, A, B>where
PointerBrand: ToDynCloneFn,
§Type Parameters
'a: The lifetime of the values.
P: The profunctor type.
I: The index 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.
PointerBrand: The reference-counted pointer type for the lens.
impl<'a, P: Strong, I: 'a, S: 'a, T: 'a, A: 'a, B: 'a, PointerBrand> IndexedOpticAdapterDiscardsFocus<'a, P, I, S, T, A, B> for IndexedLens<'a, PointerBrand, I, S, T, A, B>where
PointerBrand: ToDynCloneFn,
§Type Parameters
'a: The lifetime of the values.P: The profunctor type.I: The index 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.PointerBrand: The reference-counted pointer type for the lens.
Source§fn evaluate_indexed_discards_focus(
&self,
pab: Indexed<'a, P, I, A, B>,
) -> <P as Kind_266801a817966495>::Of<'a, S, T>
fn evaluate_indexed_discards_focus( &self, pab: Indexed<'a, P, I, A, B>, ) -> <P as Kind_266801a817966495>::Of<'a, S, T>
§Type Signature
forall P I S T A B PointerBrand. (Strong P, ToDynCloneFn PointerBrand) => (&IndexedLens P I S T A B PointerBrand, Indexed P I A B) -> P S T
§Parameters
&self: The indexed lens instance.pab: The indexed profunctor value.
§Returns
The transformed profunctor value.
§Examples
use fp_library::{
brands::{
RcBrand,
RcFnBrand,
optics::*,
},
functions::*,
types::optics::*,
};
let l: IndexedLensPrime<RcBrand, usize, (i32, String), i32> =
IndexedLensPrime::from_iview_set(|(x, _)| (10, x), |((_, s), x)| (x, s));
let result = optics_indexed_fold_map::<RcBrand, _, _, _, String>(
&l,
|i, _| format!("{}", i),
(42, "hi".to_string()),
);
assert_eq!(result, "10");Source§impl<'a, Q, I: 'a, S: 'a, T: 'a, A: 'a, B: 'a, PointerBrand> IndexedSetterOptic<'a, Q, I, S, T, A, B> for IndexedLens<'a, PointerBrand, I, S, T, A, B>where
PointerBrand: ToDynCloneFn,
Q: ToDynCloneFn,
§Type Parameters
'a: The lifetime of the values.
Q: The reference-counted pointer type for the setter brand.
I: The index 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.
PointerBrand: The reference-counted pointer type for the lens.
impl<'a, Q, I: 'a, S: 'a, T: 'a, A: 'a, B: 'a, PointerBrand> IndexedSetterOptic<'a, Q, I, S, T, A, B> for IndexedLens<'a, PointerBrand, I, S, T, A, B>where
PointerBrand: ToDynCloneFn,
Q: ToDynCloneFn,
§Type Parameters
'a: The lifetime of the values.Q: The reference-counted pointer type for the setter brand.I: The index 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.PointerBrand: The reference-counted pointer type for the lens.
Source§fn evaluate(
&self,
pab: Indexed<'a, FnBrand<Q>, I, A, B>,
) -> <FnBrand<Q> as Kind_266801a817966495>::Of<'a, S, T>
fn evaluate( &self, pab: Indexed<'a, FnBrand<Q>, I, A, B>, ) -> <FnBrand<Q> as Kind_266801a817966495>::Of<'a, S, T>
§Type Signature
forall Q I S T A B PointerBrand. (ToDynCloneFn PointerBrand, ToDynCloneFn Q) => (&IndexedLens Q I S T A B PointerBrand, Indexed (Fn Q) I A B) -> Fn Q S T
§Parameters
&self: The indexed lens instance.pab: The indexed profunctor value to transform.
§Returns
The transformed profunctor value.
§Examples
use fp_library::{
brands::{
optics::*,
*,
},
classes::optics::*,
types::optics::*,
};
let l: IndexedLens<RcBrand, usize, (i32, String), (i32, String), i32, i32> =
IndexedLens::from_iview_set(|(x, _)| (0, x), |((_, s), x)| (x, s));
let f = std::rc::Rc::new(|(i, x): (usize, i32)| x + (i as i32))
as std::rc::Rc<dyn Fn((usize, i32)) -> i32>;
let pab = Indexed::<RcFnBrand, _, _, _>::new(f);
let result: std::rc::Rc<dyn Fn((i32, String)) -> (i32, String)> =
IndexedSetterOptic::evaluate(&l, pab);
assert_eq!(result((42, "hi".to_string())), (42, "hi".to_string()));Source§impl<'a, PointerBrand, I: 'a, S: 'a, T: 'a, A: 'a, B: 'a> IndexedTraversalOptic<'a, I, S, T, A, B> for IndexedLens<'a, PointerBrand, I, S, T, A, B>where
PointerBrand: ToDynCloneFn,
§Type Parameters
'a: The lifetime of the values.
PointerBrand: The reference-counted pointer type.
I: The index 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, I: 'a, S: 'a, T: 'a, A: 'a, B: 'a> IndexedTraversalOptic<'a, I, S, T, A, B> for IndexedLens<'a, PointerBrand, I, S, T, A, B>where
PointerBrand: ToDynCloneFn,
§Type Parameters
'a: The lifetime of the values.PointerBrand: The reference-counted pointer type.I: The index 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: Indexed<'a, Q, I, A, B>,
) -> <Q as Kind_266801a817966495>::Of<'a, S, T>
fn evaluate<Q: Wander>( &self, pab: Indexed<'a, Q, I, A, B>, ) -> <Q as Kind_266801a817966495>::Of<'a, S, T>
§Type Signature
forall PointerBrand I S T A B Q. (Wander Q, ToDynCloneFn PointerBrand) => (&IndexedLens PointerBrand I S T A B, Indexed Q I A B) -> Q S T
§Type Parameters
Q: The profunctor type.
§Parameters
&self: The indexed lens instance.pab: The indexed profunctor value to transform.
§Returns
The transformed profunctor value.
§Examples
use fp_library::{
brands::{
optics::*,
*,
},
classes::optics::*,
types::optics::*,
};
let l: IndexedLens<RcBrand, usize, (i32, String), (i32, String), i32, i32> =
IndexedLens::from_iview_set(|(x, _)| (0, x), |((_, s), x)| (x, s));
let f = std::rc::Rc::new(|(i, x): (usize, i32)| x + (i as i32))
as std::rc::Rc<dyn Fn((usize, i32)) -> i32>;
let pab = Indexed::<RcFnBrand, _, _, _>::new(f);
let result: std::rc::Rc<dyn Fn((i32, String)) -> (i32, String)> =
IndexedTraversalOptic::evaluate::<RcFnBrand>(&l, pab);
assert_eq!(result((42, "hi".to_string())), (42, "hi".to_string()));Auto Trait Implementations§
impl<'a, PointerBrand, I, S, T, A, B> Freeze for IndexedLens<'a, PointerBrand, I, S, T, A, B>where
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(S) -> ((I, A), <PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(B) -> T + 'a>) + 'a>: Freeze,
impl<'a, PointerBrand, I, S, T, A, B> RefUnwindSafe for IndexedLens<'a, PointerBrand, I, S, T, A, B>where
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(S) -> ((I, A), <PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(B) -> T + 'a>) + 'a>: RefUnwindSafe,
impl<'a, PointerBrand, I, S, T, A, B> Send for IndexedLens<'a, PointerBrand, I, S, T, A, B>where
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(S) -> ((I, A), <PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(B) -> T + 'a>) + 'a>: Send,
impl<'a, PointerBrand, I, S, T, A, B> Sync for IndexedLens<'a, PointerBrand, I, S, T, A, B>where
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(S) -> ((I, A), <PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(B) -> T + 'a>) + 'a>: Sync,
impl<'a, PointerBrand, I, S, T, A, B> Unpin for IndexedLens<'a, PointerBrand, I, S, T, A, B>where
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(S) -> ((I, A), <PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(B) -> T + 'a>) + 'a>: Unpin,
impl<'a, PointerBrand, I, S, T, A, B> UnsafeUnpin for IndexedLens<'a, PointerBrand, I, S, T, A, B>where
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(S) -> ((I, A), <PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(B) -> T + 'a>) + 'a>: UnsafeUnpin,
impl<'a, PointerBrand, I, S, T, A, B> UnwindSafe for IndexedLens<'a, PointerBrand, I, S, T, A, B>where
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(S) -> ((I, A), <PointerBrand as RefCountedPointer>::Of<'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