Skip to main content

Iso

Struct Iso 

Source
pub struct Iso<'a, PointerBrand, S, T, A, B>
where PointerBrand: UnsizedCoercible, S: 'a, T: 'a, A: 'a, B: 'a,
{ pub from: <FnBrand<PointerBrand> as Kind_266801a817966495>::Of<'a, S, A>, pub to: <FnBrand<PointerBrand> as Kind_266801a817966495>::Of<'a, B, T>, }
Expand description

A polymorphic isomorphism where types can change. This matches PureScript’s Iso s t a b.

An isomorphism represents a lossless bidirectional conversion between types. 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§

§from: <FnBrand<PointerBrand> as Kind_266801a817966495>::Of<'a, S, A>

Forward conversion: from structure to focus.

§to: <FnBrand<PointerBrand> as Kind_266801a817966495>::Of<'a, B, T>

Backward conversion: from focus to structure.

Implementations§

Source§

impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> Iso<'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

pub fn new(from: impl 'a + Fn(S) -> A, to: impl 'a + Fn(B) -> T) -> Self

Create a new polymorphic isomorphism.

§Type Signature

forall PointerBrand S T A B. UnsizedCoercible PointerBrand => (S -> A, B -> T) -> Iso PointerBrand S T A B

§Parameters
  • from: The forward conversion function.
  • to: The backward conversion function.
§Returns

A new instance of the type.

§Examples
use fp_library::{
	brands::RcBrand,
	types::optics::Iso,
};

// Iso between String and Vec<char>
let string_chars: Iso<RcBrand, String, String, Vec<char>, Vec<char>> =
	Iso::new(|s: String| s.chars().collect(), |v: Vec<char>| v.into_iter().collect());
assert_eq!(string_chars.from("hi".to_string()), vec!['h', 'i']);
Source

pub fn from(&self, s: S) -> A

Apply the forward conversion.

§Type Signature

forall PointerBrand S T A B. UnsizedCoercible PointerBrand => (&Iso PointerBrand S T A B, S) -> A

§Parameters
  • &self: The iso instance.
  • s: The structure to convert.
§Returns

The focus value.

§Examples
use fp_library::{
	brands::RcBrand,
	types::optics::Iso,
};

let string_chars: Iso<RcBrand, String, String, Vec<char>, Vec<char>> =
	Iso::new(|s: String| s.chars().collect(), |v: Vec<char>| v.into_iter().collect());
let chars = string_chars.from("hello".to_string());
assert_eq!(chars, vec!['h', 'e', 'l', 'l', 'o']);
Source

pub fn to(&self, b: B) -> T

Apply the backward conversion.

§Type Signature

forall PointerBrand S T A B. UnsizedCoercible PointerBrand => (&Iso PointerBrand S T A B, B) -> T

§Parameters
  • &self: The iso instance.
  • b: The focus value to convert.
§Returns

The structure value.

§Examples
use fp_library::{
	brands::RcBrand,
	types::optics::Iso,
};

let string_chars: Iso<RcBrand, String, String, Vec<char>, Vec<char>> =
	Iso::new(|s: String| s.chars().collect(), |v: Vec<char>| v.into_iter().collect());
let s = string_chars.to(vec!['h', 'i']);
assert_eq!(s, "hi");

Trait Implementations§

Source§

impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> AffineTraversalOptic<'a, S, T, A, B> for Iso<'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>

§Type Signature

forall PointerBrand S T A B Q. (Strong Q, Choice Q, UnsizedCoercible PointerBrand) => (&Iso PointerBrand S T A B, Q A B) -> Q S T

§Type Parameters
  • Q: The profunctor type.
§Parameters
  • &self: The iso instance.
  • pab: The profunctor value to transform.
§Returns

The transformed profunctor value.

§Examples
use fp_library::{
	brands::{
		optics::*,
		*,
	},
	classes::optics::*,
	functions::*,
	types::optics::*,
};

let iso: Iso<RcBrand, (i32,), (i32,), i32, i32> = Iso::new(|(x,)| x, |x| (x,));
let f = cloneable_fn_new::<RcFnBrand, _, _>(|x: i32| x + 1);
let modifier: std::rc::Rc<dyn Fn((i32,)) -> (i32,)> =
	AffineTraversalOptic::evaluate::<RcFnBrand>(&iso, f);
assert_eq!(modifier((41,)), (42,));
Source§

impl<'a, PointerBrand, S, T, A, B> Clone for Iso<'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

§Type Signature

forall PointerBrand S T A B. UnsizedCoercible PointerBrand => &Iso PointerBrand S T A B -> Iso PointerBrand S T A B

§Returns

A new Iso instance that is a copy of the original.

§Examples
use fp_library::{
	brands::RcBrand,
	types::optics::Iso,
};

let string_chars: Iso<RcBrand, String, String, Vec<char>, Vec<char>> =
	Iso::new(|s: String| s.chars().collect(), |v: Vec<char>| v.into_iter().collect());
let cloned = string_chars.clone();
assert_eq!(cloned.from("hi".to_string()), vec!['h', 'i']);
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, PointerBrand, S: 'a, A: 'a> FoldOptic<'a, S, A> for Iso<'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>

§Type Signature

forall PointerBrand S A R Q. (Monoid R, UnsizedCoercible Q, UnsizedCoercible PointerBrand) => (&Iso 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 iso instance.
  • pab: The profunctor value to transform.
§Returns

The transformed profunctor value.

§Examples
use fp_library::{
	brands::{
		optics::*,
		*,
	},
	classes::optics::*,
	functions::*,
	types::optics::*,
};

let iso: Iso<RcBrand, (i32,), (i32,), i32, i32> = Iso::new(|(x,)| x, |x| (x,));
let f = Forget::<RcBrand, String, i32, i32>::new(|x| x.to_string());
let folded = FoldOptic::evaluate(&iso, f);
assert_eq!(folded.run((42,)), "42".to_string());
Source§

impl<'a, PointerBrand, S: 'a, A: 'a> GetterOptic<'a, S, A> for Iso<'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>

§Type Signature

forall PointerBrand S A R Q. (UnsizedCoercible Q, UnsizedCoercible PointerBrand) => (&Iso 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 iso instance.
  • pab: The profunctor value to transform.
§Returns

The transformed profunctor value.

§Examples
use fp_library::{
	brands::{
		optics::*,
		*,
	},
	classes::optics::*,
	functions::*,
	types::optics::*,
};

let iso: Iso<RcBrand, (i32,), (i32,), i32, i32> = Iso::new(|(x,)| x, |x| (x,));
let f = Forget::<RcBrand, i32, i32, i32>::new(|x| x);
let folded = GetterOptic::evaluate(&iso, f);
assert_eq!(folded.run((42,)), 42);
Source§

impl<'a, FunctionBrand: CloneableFn, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> GrateOptic<'a, FunctionBrand, S, T, A, B> for Iso<'a, PointerBrand, S, T, A, B>
where PointerBrand: UnsizedCoercible,

§Type Parameters
  • 'a: The lifetime of the values.
  • FunctionBrand: The cloneable function brand used by the profunctor’s Closed instance.
  • 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: Closed<FunctionBrand>>( &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. (Closed Q, UnsizedCoercible PointerBrand) => (&Iso FunctionBrand PointerBrand S T A B, Q A B) -> Q S T

§Type Parameters
  • Q: The profunctor type.
§Parameters
  • &self: The iso instance.
  • pab: The profunctor value to transform.
§Returns

The transformed profunctor value.

§Examples
use fp_library::{
	brands::{
		optics::*,
		*,
	},
	classes::optics::*,
	functions::*,
	types::optics::*,
};

let iso: Iso<RcBrand, (i32,), (i32,), i32, i32> = Iso::new(|(x,)| x, |x| (x,));
let f = cloneable_fn_new::<RcFnBrand, _, _>(|x: i32| x + 1);
let modifier: std::rc::Rc<dyn Fn((i32,)) -> (i32,)> =
	GrateOptic::<RcFnBrand, _, _, _, _>::evaluate::<RcFnBrand>(&iso, f);
assert_eq!(modifier((41,)), (42,));
Source§

impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> IsoOptic<'a, S, T, A, B> for Iso<'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: Profunctor + 'static>( &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. (Profunctor Q, UnsizedCoercible PointerBrand) => (&Iso PointerBrand S T A B, Q A B) -> Q S T

§Type Parameters
  • Q: The profunctor type.
§Parameters
  • &self: The iso instance.
  • pab: The profunctor value to transform.
§Returns

The transformed profunctor value.

§Examples
use fp_library::{
	brands::{
		optics::*,
		*,
	},
	classes::optics::*,
	functions::*,
	types::optics::*,
};

let iso: Iso<RcBrand, (i32,), (i32,), i32, i32> = Iso::new(|(x,)| x, |x| (x,));
let f = cloneable_fn_new::<RcFnBrand, _, _>(|x: i32| x + 1);
let modifier: std::rc::Rc<dyn Fn((i32,)) -> (i32,)> = IsoOptic::evaluate::<RcFnBrand>(&iso, f);
assert_eq!(modifier((41,)), (42,));
Source§

impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> LensOptic<'a, S, T, A, B> for Iso<'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>

§Type Signature

forall PointerBrand S T A B Q. (Strong Q, UnsizedCoercible PointerBrand) => (&Iso PointerBrand S T A B, Q A B) -> Q S T

§Type Parameters
  • Q: The profunctor type.
§Parameters
  • &self: The iso instance.
  • pab: The profunctor value to transform.
§Returns

The transformed profunctor value.

§Examples
use fp_library::{
	brands::{
		optics::*,
		*,
	},
	classes::optics::*,
	functions::*,
	types::optics::*,
};

let iso: Iso<RcBrand, (i32,), (i32,), i32, i32> = Iso::new(|(x,)| x, |x| (x,));
let f = cloneable_fn_new::<RcFnBrand, _, _>(|x: i32| x + 1);
let modifier: std::rc::Rc<dyn Fn((i32,)) -> (i32,)> = LensOptic::evaluate::<RcFnBrand>(&iso, f);
assert_eq!(modifier((41,)), (42,));
Source§

impl<'a, Q, PointerBrand, S, T, A, B> Optic<'a, Q, S, T, A, B> for Iso<'a, PointerBrand, S, T, A, B>
where Q: Profunctor, 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>

§Type Signature

forall Q PointerBrand S T A B. (Profunctor Q, UnsizedCoercible PointerBrand) => (&Iso Q PointerBrand S T A B, Q A B) -> Q S T

§Parameters
  • &self: The iso instance.
  • pab: The profunctor value to transform.
§Returns

The transformed profunctor value.

§Examples
use fp_library::{
	brands::{
		optics::*,
		*,
	},
	classes::optics::*,
	functions::*,
	types::optics::*,
};

let iso: Iso<RcBrand, (i32,), (i32,), i32, i32> = Iso::new(|(x,)| x, |x| (x,));
let f = cloneable_fn_new::<RcFnBrand, _, _>(|x: i32| x + 1);
let modifier = Optic::<RcFnBrand, _, _, _, _>::evaluate(&iso, f);
assert_eq!(modifier((41,)), (42,));
Source§

impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> PrismOptic<'a, S, T, A, B> for Iso<'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: 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, UnsizedCoercible PointerBrand) => (&Iso PointerBrand S T A B, Q A B) -> Q S T

§Type Parameters
  • Q: The profunctor type.
§Parameters
  • &self: The iso instance.
  • pab: The profunctor value to transform.
§Returns

The transformed profunctor value.

§Examples
use fp_library::{
	brands::{
		optics::*,
		*,
	},
	classes::optics::*,
	functions::*,
	types::optics::*,
};

let iso: Iso<RcBrand, (i32,), (i32,), i32, i32> = Iso::new(|(x,)| x, |x| (x,));
let f = cloneable_fn_new::<RcFnBrand, _, _>(|x: i32| x + 1);
let modifier: std::rc::Rc<dyn Fn((i32,)) -> (i32,)> =
	PrismOptic::evaluate::<RcFnBrand>(&iso, f);
assert_eq!(modifier((41,)), (42,));
Source§

impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> ReviewOptic<'a, S, T, A, B> for Iso<'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( &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. UnsizedCoercible PointerBrand => (&Iso PointerBrand S T A B, Tagged A B) -> Tagged S T

§Parameters
  • &self: The iso instance.
  • pab: The profunctor value to transform.
§Returns

The transformed profunctor value.

§Examples
use fp_library::{
	brands::{
		optics::*,
		*,
	},
	classes::optics::*,
	functions::*,
	types::optics::*,
};

let iso: Iso<RcBrand, (i32,), (i32,), i32, i32> = Iso::new(|(x,)| x, |x| (x,));
let f = Tagged::new(42);
let reviewed = ReviewOptic::evaluate(&iso, f);
assert_eq!(reviewed.0, (42,));
Source§

impl<'a, Q, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> SetterOptic<'a, Q, S, T, A, B> for Iso<'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 iso.
  • 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>

§Type Signature

forall Q PointerBrand S T A B. (UnsizedCoercible PointerBrand, UnsizedCoercible Q) => (&Iso Q PointerBrand S T A B, Fn Q A B) -> Fn Q S T

§Parameters
  • &self: The iso instance.
  • pab: The profunctor value to transform.
§Returns

The transformed profunctor value.

§Examples
use fp_library::{
	brands::{
		optics::*,
		*,
	},
	classes::optics::*,
	functions::*,
	types::optics::*,
};

let iso: Iso<RcBrand, (i32,), (i32,), i32, i32> = Iso::new(|(x,)| x, |x| (x,));
let f = cloneable_fn_new::<RcFnBrand, _, _>(|x: i32| x + 1);
let modifier: std::rc::Rc<dyn Fn((i32,)) -> (i32,)> =
	SetterOptic::<RcBrand, _, _, _, _>::evaluate(&iso, f);
assert_eq!(modifier((41,)), (42,));
Source§

impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> TraversalOptic<'a, S, T, A, B> for Iso<'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>

§Type Signature

forall PointerBrand S T A B Q. (Wander Q, UnsizedCoercible PointerBrand) => (&Iso PointerBrand S T A B, Q A B) -> Q S T

§Type Parameters
  • Q: The profunctor type.
§Parameters
  • &self: The iso instance.
  • pab: The profunctor value to transform.
§Returns

The transformed profunctor value.

§Examples
use fp_library::{
	brands::{
		optics::*,
		*,
	},
	classes::optics::*,
	functions::*,
	types::optics::*,
};

let iso: Iso<RcBrand, (i32,), (i32,), i32, i32> = Iso::new(|(x,)| x, |x| (x,));
let f = cloneable_fn_new::<RcFnBrand, _, _>(|x: i32| x + 1);
let modifier: std::rc::Rc<dyn Fn((i32,)) -> (i32,)> =
	TraversalOptic::evaluate::<RcFnBrand>(&iso, f);
assert_eq!(modifier((41,)), (42,));

Auto Trait Implementations§

§

impl<'a, PointerBrand, S, T, A, B> Freeze for Iso<'a, PointerBrand, S, T, A, B>
where <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(S) -> A + 'a>: Freeze, <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(B) -> T + 'a>: Freeze,

§

impl<'a, PointerBrand, S, T, A, B> RefUnwindSafe for Iso<'a, PointerBrand, S, T, A, B>
where <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(S) -> A + 'a>: RefUnwindSafe, <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(B) -> T + 'a>: RefUnwindSafe,

§

impl<'a, PointerBrand, S, T, A, B> Send for Iso<'a, PointerBrand, S, T, A, B>
where <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(S) -> A + 'a>: Send, <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(B) -> T + 'a>: Send,

§

impl<'a, PointerBrand, S, T, A, B> Sync for Iso<'a, PointerBrand, S, T, A, B>
where <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(S) -> A + 'a>: Sync, <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(B) -> T + 'a>: Sync,

§

impl<'a, PointerBrand, S, T, A, B> Unpin for Iso<'a, PointerBrand, S, T, A, B>
where <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(S) -> A + 'a>: Unpin, <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(B) -> T + 'a>: Unpin,

§

impl<'a, PointerBrand, S, T, A, B> UnsafeUnpin for Iso<'a, PointerBrand, S, T, A, B>
where <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(S) -> A + 'a>: UnsafeUnpin, <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(B) -> T + 'a>: UnsafeUnpin,

§

impl<'a, PointerBrand, S, T, A, B> UnwindSafe for Iso<'a, PointerBrand, S, T, A, B>
where <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(S) -> A + 'a>: UnwindSafe, <PointerBrand as RefCountedPointer>::CloneableOf<'a, dyn Fn(B) -> T + 'a>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pipe for T

Source§

fn pipe<B>(self, f: impl FnOnce(Self) -> B) -> B

Pipes self into a function, enabling left-to-right composition. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.