pub struct InBetween<NK, EK, Old, New> { /* private fields */ }
Expand description
A Schema that is inbetween two other schemas. This allows a user to make changes to the data before it is fully converted into the other schema
Implementations§
Source§impl<NK, EK, Old, New> InBetween<NK, EK, Old, New>
impl<NK, EK, Old, New> InBetween<NK, EK, Old, New>
pub fn new(old: Old, new: New) -> InBetween<NK, EK, Old, New>
pub fn get_old_schema(&self) -> &Old
pub fn get_new_schema(&self) -> &New
pub fn to_generic_error(
&self,
e: SchemaError<NK, EK, Self>,
) -> GenericTypedError<NK, EK>where
NK: Key,
EK: Key,
Old: SchemaExt<NK, EK> + MigrateSchema<NK, EK, New>,
New: SchemaExt<NK, EK>,
Trait Implementations§
Source§impl<NK: Default, EK: Default, Old: Default, New: Default> Default for InBetween<NK, EK, Old, New>
impl<NK: Default, EK: Default, Old: Default, New: Default> Default for InBetween<NK, EK, Old, New>
Source§impl<'b, NK, EK, Old, New, OE, ON, OTN: 'b, NE, NN, NTN> Downcast<'b, NK, EK, EitherVersion<&'b OTN, &'b NTN>, InBetween<NK, EK, Old, New>> for EitherVersion<ON, NN>
impl<'b, NK, EK, Old, New, OE, ON, OTN: 'b, NE, NN, NTN> Downcast<'b, NK, EK, EitherVersion<&'b OTN, &'b NTN>, InBetween<NK, EK, Old, New>> for EitherVersion<ON, NN>
Source§fn downcast<'a: 'b>(
&'a self,
) -> SchemaResult<EitherVersion<&'b OTN, &'b NTN>, NK, EK, InBetween<NK, EK, Old, New>>
fn downcast<'a: 'b>( &'a self, ) -> SchemaResult<EitherVersion<&'b OTN, &'b NTN>, NK, EK, InBetween<NK, EK, Old, New>>
Cast a node or edge into a more specific type Read more
Source§impl<NK, EK, OldVersion, NewVersion> MigrateSchema<NK, EK, NewVersion> for InBetween<NK, EK, OldVersion, NewVersion>where
NK: Key,
EK: Key,
OldVersion: SchemaExt<NK, EK> + MigrateSchema<NK, EK, NewVersion>,
NewVersion: SchemaExt<NK, EK>,
impl<NK, EK, OldVersion, NewVersion> MigrateSchema<NK, EK, NewVersion> for InBetween<NK, EK, OldVersion, NewVersion>where
NK: Key,
EK: Key,
OldVersion: SchemaExt<NK, EK> + MigrateSchema<NK, EK, NewVersion>,
NewVersion: SchemaExt<NK, EK>,
Source§fn update_edge(
&self,
new_schema: &NewVersion,
edge: Self::E,
) -> SchemaResult<Option<<NewVersion as SchemaExt<NK, EK>>::E>, NK, EK, NewVersion>
fn update_edge( &self, new_schema: &NewVersion, edge: Self::E, ) -> SchemaResult<Option<<NewVersion as SchemaExt<NK, EK>>::E>, NK, EK, NewVersion>
Update an edge from its old type to the new one Read more
Source§fn update_node(
&self,
new_schema: &NewVersion,
node: Self::N,
) -> SchemaResult<Option<<NewVersion as SchemaExt<NK, EK>>::N>, NK, EK, NewVersion>
fn update_node( &self, new_schema: &NewVersion, node: Self::N, ) -> SchemaResult<Option<<NewVersion as SchemaExt<NK, EK>>::N>, NK, EK, NewVersion>
Update a node from its old type to the new one Read more
Source§impl<NK, EK, OldVersion, NewVersion> SchemaExt<NK, EK> for InBetween<NK, EK, OldVersion, NewVersion>where
NK: Key,
EK: Key,
OldVersion: SchemaExt<NK, EK> + MigrateSchema<NK, EK, NewVersion>,
NewVersion: SchemaExt<NK, EK>,
impl<NK, EK, OldVersion, NewVersion> SchemaExt<NK, EK> for InBetween<NK, EK, OldVersion, NewVersion>where
NK: Key,
EK: Key,
OldVersion: SchemaExt<NK, EK> + MigrateSchema<NK, EK, NewVersion>,
NewVersion: SchemaExt<NK, EK>,
Source§type N = EitherVersion<<OldVersion as SchemaExt<NK, EK>>::N, <NewVersion as SchemaExt<NK, EK>>::N>
type N = EitherVersion<<OldVersion as SchemaExt<NK, EK>>::N, <NewVersion as SchemaExt<NK, EK>>::N>
Type of node weights used by the schema
Source§type E = EitherVersion<<OldVersion as SchemaExt<NK, EK>>::E, <NewVersion as SchemaExt<NK, EK>>::E>
type E = EitherVersion<<OldVersion as SchemaExt<NK, EK>>::E, <NewVersion as SchemaExt<NK, EK>>::E>
Type of edge weights used by the schema
Source§fn allow_node(
&self,
node_ty: <Self::N as Typed>::Type,
) -> Result<(), DisAllowedNode>
fn allow_node( &self, node_ty: <Self::N as Typed>::Type, ) -> Result<(), DisAllowedNode>
Before adding a new node, check if the new node is allowed Read more
Auto Trait Implementations§
impl<NK, EK, Old, New> Freeze for InBetween<NK, EK, Old, New>
impl<NK, EK, Old, New> RefUnwindSafe for InBetween<NK, EK, Old, New>
impl<NK, EK, Old, New> Send for InBetween<NK, EK, Old, New>
impl<NK, EK, Old, New> Sync for InBetween<NK, EK, Old, New>
impl<NK, EK, Old, New> Unpin for InBetween<NK, EK, Old, New>
impl<NK, EK, Old, New> UnwindSafe for InBetween<NK, EK, Old, New>
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<NK, EK, T> DirectMigration<NK, EK, T> for T
impl<NK, EK, T> DirectMigration<NK, EK, T> for T
fn migrate( g: TypedGraph<NK, EK, T>, ) -> Result<TypedGraph<NK, EK, T>, TypedError<NK, EK, String, String>>
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>
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 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>
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