pub struct Prism<'a, PointerBrand, S, T, A, B>where
PointerBrand: ToDynCloneFn,
S: 'a,
T: 'a,
A: 'a,
B: 'a,{
pub preview: <FnBrand<PointerBrand> as Kind_266801a817966495>::Of<'a, S, Result<A, T>>,
pub review: <FnBrand<PointerBrand> as Kind_266801a817966495>::Of<'a, B, T>,
}Expand description
A polymorphic prism for sum types where types can change.
This matches PureScript’s Prism s t a b.
A prism focuses on a value that may not be present (like a particular variant
of an enum). 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.
Fields§
§preview: <FnBrand<PointerBrand> as Kind_266801a817966495>::Of<'a, S, Result<A, T>>Preview function: tries to extract the focus, returning the target structure T on failure.
review: <FnBrand<PointerBrand> as Kind_266801a817966495>::Of<'a, B, T>Review function: constructs the structure from a focus value.
Implementations§
Source§impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> Prism<'a, PointerBrand, S, T, A, B>where
PointerBrand: ToDynCloneFn,
§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> Prism<'a, PointerBrand, S, T, A, B>where
PointerBrand: ToDynCloneFn,
§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(
preview: impl 'a + Fn(S) -> Result<A, T>,
review: impl 'a + Fn(B) -> T,
) -> Self
pub fn new( preview: impl 'a + Fn(S) -> Result<A, T>, review: impl 'a + Fn(B) -> T, ) -> Self
Create a new polymorphic prism.
§Type Signature
forall PointerBrand S T A B. ToDynCloneFn PointerBrand => (S -> Result A T, B -> T) -> Prism PointerBrand S T A B
§Parameters
preview: The preview function.review: The review function.
§Returns
A new instance of the type.
§Examples
use fp_library::{
brands::RcBrand,
types::optics::Prism,
};
let ok_prism: Prism<RcBrand, Option<i32>, Option<f64>, i32, f64> =
Prism::new(|o: Option<i32>| o.ok_or(None), |f| Some(f));
assert_eq!(ok_prism.preview(Some(42)), Ok(42));Sourcepub fn preview(&self, s: S) -> Result<A, T>
pub fn preview(&self, s: S) -> Result<A, T>
Preview the focus of the prism in a structure.
§Type Signature
forall PointerBrand S T A B. ToDynCloneFn PointerBrand => (&Prism PointerBrand S T A B, S) -> Result A T
§Parameters
&self: The prism instance.s: The structure to preview.
§Returns
A result containing the focus value if it exists, or the original structure (possibly with changed type) if not.
§Examples
use fp_library::{
brands::RcBrand,
types::optics::Prism,
};
let ok_prism: Prism<RcBrand, Option<i32>, Option<f64>, i32, f64> =
Prism::new(|o: Option<i32>| o.ok_or(None), |f| Some(f));
assert_eq!(ok_prism.preview(Some(42)), Ok(42));Sourcepub fn review(&self, b: B) -> T
pub fn review(&self, b: B) -> T
Review the focus into the structure.
§Type Signature
forall PointerBrand S T A B. ToDynCloneFn PointerBrand => (&Prism PointerBrand S T A B, B) -> T
§Parameters
&self: The prism instance.b: The focus value.
§Returns
The structure containing the focus value.
§Examples
use fp_library::{
brands::RcBrand,
types::optics::Prism,
};
let ok_prism: Prism<RcBrand, Option<i32>, Option<f64>, i32, f64> =
Prism::new(|o: Option<i32>| o.ok_or(None), |f| Some(f));
assert_eq!(ok_prism.review(42.0), Some(42.0));Trait Implementations§
Source§impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> AffineTraversalOptic<'a, S, T, A, B> for Prism<'a, PointerBrand, S, T, A, B>where
PointerBrand: ToDynCloneFn,
§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 Prism<'a, PointerBrand, S, T, A, B>where
PointerBrand: ToDynCloneFn,
§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, ToDynCloneFn PointerBrand) => (&Prism PointerBrand S T A B, Q A B) -> Q S T
§Type Parameters
Q: The profunctor type.
§Parameters
&self: The prism 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 ok_prism: Prism<RcBrand, Option<i32>, Option<i32>, i32, i32> =
Prism::new(|o: Option<i32>| o.ok_or(None), |x| Some(x));
let f = lift_fn_new::<RcFnBrand, _, _>(|x: i32| x * 2);
let modifier: Rc<dyn Fn(Option<i32>) -> Option<i32>> =
AffineTraversalOptic::evaluate::<RcFnBrand>(&ok_prism, f);
assert_eq!(modifier(Some(21)), Some(42));Source§impl<'a, PointerBrand, S, T, A, B> Clone for Prism<'a, PointerBrand, S, T, A, B>where
PointerBrand: ToDynCloneFn,
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 Prism<'a, PointerBrand, S, T, A, B>where
PointerBrand: ToDynCloneFn,
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. ToDynCloneFn PointerBrand => &Prism PointerBrand S T A B -> Prism PointerBrand S T A B
§Returns
A new Prism instance that is a copy of the original.
§Examples
use fp_library::{
brands::RcBrand,
types::optics::Prism,
};
let ok_prism: Prism<RcBrand, Option<i32>, Option<f64>, i32, f64> =
Prism::new(|o: Option<i32>| o.ok_or(None), |f| Some(f));
let cloned = ok_prism.clone();
assert_eq!(cloned.preview(Some(42)), Ok(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 Prism<'a, PointerBrand, S, S, A, A>where
PointerBrand: ToDynCloneFn,
§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 Prism<'a, PointerBrand, S, S, A, A>where
PointerBrand: ToDynCloneFn,
§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: ToDynCloneFn + '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: ToDynCloneFn + '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, ToDynCloneFn Q, ToDynCloneFn PointerBrand) => (&Prism 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 for the Forget brand.
§Parameters
&self: The prism instance.pab: The profunctor value to transform.
§Returns
The transformed profunctor value.
§Examples
use fp_library::{
brands::{
optics::*,
*,
},
classes::optics::*,
functions::*,
types::optics::*,
};
let ok_prism: Prism<RcBrand, Option<i32>, Option<i32>, i32, i32> =
Prism::new(|o: Option<i32>| o.ok_or(None), |x| Some(x));
let f = Forget::<RcBrand, String, i32, i32>::new(|x| x.to_string());
let folded = FoldOptic::evaluate(&ok_prism, f);
assert_eq!(folded.run(Some(42)), "42".to_string());Source§impl<'a, Q, PointerBrand, S, T, A, B> Optic<'a, Q, S, T, A, B> for Prism<'a, PointerBrand, S, T, A, B>where
Q: Choice,
PointerBrand: ToDynCloneFn,
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 Prism<'a, PointerBrand, S, T, A, B>where
Q: Choice,
PointerBrand: ToDynCloneFn,
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. (Choice Q, ToDynCloneFn PointerBrand) => (&Prism Q PointerBrand S T A B, Q A B) -> Q S T
§Parameters
&self: The prism instance.pab: The profunctor value to transform.
§Returns
The transformed profunctor value.
§Examples
use fp_library::{
brands::{
optics::*,
*,
},
classes::optics::*,
functions::*,
types::optics::*,
};
let ok_prism: Prism<RcBrand, Option<i32>, Option<i32>, i32, i32> =
Prism::new(|o: Option<i32>| o.ok_or(None), |x| Some(x));
let f = lift_fn_new::<RcFnBrand, _, _>(|x: i32| x * 2);
let modifier = Optic::<RcFnBrand, _, _, _, _>::evaluate(&ok_prism, f);
assert_eq!(modifier(Some(21)), Some(42));
assert_eq!(modifier(None), None);Source§impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> PrismOptic<'a, S, T, A, B> for Prism<'a, PointerBrand, S, T, A, B>where
PointerBrand: ToDynCloneFn,
§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> PrismOptic<'a, S, T, A, B> for Prism<'a, PointerBrand, S, T, A, B>where
PointerBrand: ToDynCloneFn,
§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: Choice>(
&self,
pab: <Q as Kind_266801a817966495>::Of<'a, A, B>,
) -> <Q as Kind_266801a817966495>::Of<'a, S, T>
fn evaluate<Q: 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. (Choice Q, ToDynCloneFn PointerBrand) => (&Prism PointerBrand S T A B, Q A B) -> Q S T
§Type Parameters
Q: The profunctor type.
§Parameters
&self: The prism 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 ok_prism: Prism<RcBrand, Option<i32>, Option<i32>, i32, i32> =
Prism::new(|o: Option<i32>| o.ok_or(None), |x| Some(x));
let f = lift_fn_new::<RcFnBrand, _, _>(|x: i32| x * 2);
let modifier: Rc<dyn Fn(Option<i32>) -> Option<i32>> =
PrismOptic::evaluate::<RcFnBrand>(&ok_prism, f);
assert_eq!(modifier(Some(21)), Some(42));Source§impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> ReviewOptic<'a, S, T, A, B> for Prism<'a, PointerBrand, S, T, A, B>where
PointerBrand: ToDynCloneFn,
§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> ReviewOptic<'a, S, T, A, B> for Prism<'a, PointerBrand, S, T, A, B>where
PointerBrand: ToDynCloneFn,
§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(
&self,
pab: <TaggedBrand as Kind_266801a817966495>::Of<'a, A, B>,
) -> <TaggedBrand as Kind_266801a817966495>::Of<'a, S, T>
fn evaluate( &self, pab: <TaggedBrand as Kind_266801a817966495>::Of<'a, A, B>, ) -> <TaggedBrand as Kind_266801a817966495>::Of<'a, S, T>
§Type Signature
forall PointerBrand S T A B. ToDynCloneFn PointerBrand => (&Prism PointerBrand S T A B, Tagged A B) -> Tagged S T
§Parameters
&self: The prism instance.pab: The profunctor value to transform.
§Returns
The transformed profunctor value.
§Examples
use fp_library::{
brands::{
optics::*,
*,
},
classes::optics::*,
functions::*,
types::optics::*,
};
let ok_prism: Prism<RcBrand, Option<i32>, Option<i32>, i32, i32> =
Prism::new(|o: Option<i32>| o.ok_or(None), |x| Some(x));
let f = Tagged::new(42);
let reviewed = ReviewOptic::evaluate(&ok_prism, f);
assert_eq!(reviewed.0, Some(42));Source§impl<'a, Q, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> SetterOptic<'a, Q, S, T, A, B> for Prism<'a, PointerBrand, 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.
PointerBrand: The reference-counted pointer type for the prism.
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 Prism<'a, PointerBrand, 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.PointerBrand: The reference-counted pointer type for the prism.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. (ToDynCloneFn PointerBrand, ToDynCloneFn Q) => (&Prism Q PointerBrand S T A B, Fn Q A B) -> Fn Q S T
§Parameters
&self: The prism 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 ok_prism: Prism<RcBrand, Option<i32>, Option<i32>, i32, i32> =
Prism::new(|o: Option<i32>| o.ok_or(None), |x| Some(x));
let f = lift_fn_new::<RcFnBrand, _, _>(|x: i32| x * 2);
let modifier: Rc<dyn Fn(Option<i32>) -> Option<i32>> =
SetterOptic::<RcBrand, _, _, _, _>::evaluate(&ok_prism, f);
assert_eq!(modifier(Some(21)), Some(42));Source§impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> TraversalOptic<'a, S, T, A, B> for Prism<'a, PointerBrand, S, T, A, B>where
PointerBrand: ToDynCloneFn,
§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 Prism<'a, PointerBrand, S, T, A, B>where
PointerBrand: ToDynCloneFn,
§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, ToDynCloneFn PointerBrand) => (&Prism PointerBrand S T A B, Q A B) -> Q S T
§Type Parameters
Q: The profunctor type.
§Parameters
&self: The prism 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 ok_prism: Prism<RcBrand, Option<i32>, Option<i32>, i32, i32> =
Prism::new(|o: Option<i32>| o.ok_or(None), |x| Some(x));
let f = lift_fn_new::<RcFnBrand, _, _>(|x: i32| x * 2);
let modifier: Rc<dyn Fn(Option<i32>) -> Option<i32>> =
TraversalOptic::evaluate::<RcFnBrand>(&ok_prism, f);
assert_eq!(modifier(Some(21)), Some(42));Auto Trait Implementations§
impl<'a, PointerBrand, S, T, A, B> Freeze for Prism<'a, PointerBrand, S, T, A, B>where
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(S) -> Result<A, T> + 'a>: Freeze,
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(B) -> T + 'a>: Freeze,
impl<'a, PointerBrand, S, T, A, B> RefUnwindSafe for Prism<'a, PointerBrand, S, T, A, B>where
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(S) -> Result<A, T> + 'a>: RefUnwindSafe,
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(B) -> T + 'a>: RefUnwindSafe,
impl<'a, PointerBrand, S, T, A, B> Send for Prism<'a, PointerBrand, S, T, A, B>where
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(S) -> Result<A, T> + 'a>: Send,
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(B) -> T + 'a>: Send,
impl<'a, PointerBrand, S, T, A, B> Sync for Prism<'a, PointerBrand, S, T, A, B>where
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(S) -> Result<A, T> + 'a>: Sync,
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(B) -> T + 'a>: Sync,
impl<'a, PointerBrand, S, T, A, B> Unpin for Prism<'a, PointerBrand, S, T, A, B>where
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(S) -> Result<A, T> + 'a>: Unpin,
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(B) -> T + 'a>: Unpin,
impl<'a, PointerBrand, S, T, A, B> UnsafeUnpin for Prism<'a, PointerBrand, S, T, A, B>where
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(S) -> Result<A, T> + 'a>: UnsafeUnpin,
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(B) -> T + 'a>: UnsafeUnpin,
impl<'a, PointerBrand, S, T, A, B> UnwindSafe for Prism<'a, PointerBrand, S, T, A, B>where
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(S) -> Result<A, T> + 'a>: UnwindSafe,
<PointerBrand as RefCountedPointer>::Of<'a, dyn Fn(B) -> T + '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