Struct InBetween

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

Source

pub fn new(old: Old, new: New) -> InBetween<NK, EK, Old, New>

Source

pub fn get_old_schema(&self) -> &Old

Source

pub fn get_new_schema(&self) -> &New

Source

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: Clone, EK: Clone, Old: Clone, New: Clone> Clone for InBetween<NK, EK, Old, New>

Source§

fn clone(&self) -> InBetween<NK, EK, Old, New>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<NK: Default, EK: Default, Old: Default, New: Default> Default for InBetween<NK, EK, Old, New>

Source§

fn default() -> InBetween<NK, EK, Old, New>

Returns the “default value” for a type. Read more
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>
where NK: Key, EK: Key, OE: EdgeExt<EK>, NE: EdgeExt<EK>, ON: NodeExt<NK> + Downcast<'b, NK, EK, &'b OTN, Old>, NN: NodeExt<NK> + Downcast<'b, NK, EK, &'b NTN, New>, Old: SchemaExt<NK, EK, E = OE, N = ON> + MigrateSchema<NK, EK, New>, New: SchemaExt<NK, EK, E = NE, N = NN>,

Source§

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>,

Source§

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>

Update a node from its old type to the new one Read more
Source§

fn update_edge_type( &self, new_schema: &NewVersion, edge_type: <Self::E as Typed>::Type, ) -> Option<<<NewVersion as SchemaExt<NK, EK>>::E as Typed>::Type>

Update an edge type from its old version to its new one Read more
Source§

fn update_node_type( &self, new_schema: &NewVersion, node_type: <Self::N as Typed>::Type, ) -> Option<<<NewVersion as SchemaExt<NK, EK>>::N as Typed>::Type>

Update a node type from its old version to its 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>,

Source§

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 of edge weights used by the schema
Source§

fn name(&self) -> String

Get the name of the schema in order to provide better error messages
Source§

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

fn allow_edge( &self, outgoing_edge_count: usize, incoming_edge_count: usize, edge_ty: <Self::E as Typed>::Type, source: <Self::N as Typed>::Type, target: <Self::N as Typed>::Type, ) -> Result<(), DisAllowedEdge>

Before adding a new edge check if the new edge is allowed Read more

Auto Trait Implementations§

§

impl<NK, EK, Old, New> Freeze for InBetween<NK, EK, Old, New>
where Old: Freeze, New: Freeze,

§

impl<NK, EK, Old, New> RefUnwindSafe for InBetween<NK, EK, Old, New>

§

impl<NK, EK, Old, New> Send for InBetween<NK, EK, Old, New>
where Old: Send, New: Send, NK: Send, EK: Send,

§

impl<NK, EK, Old, New> Sync for InBetween<NK, EK, Old, New>
where Old: Sync, New: Sync, NK: Sync, EK: Sync,

§

impl<NK, EK, Old, New> Unpin for InBetween<NK, EK, Old, New>
where Old: Unpin, New: Unpin, NK: Unpin, EK: Unpin,

§

impl<NK, EK, Old, New> UnwindSafe for InBetween<NK, EK, Old, New>
where Old: UnwindSafe, New: UnwindSafe, NK: UnwindSafe, EK: 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<NK, EK, T> DirectMigration<NK, EK, T> for T
where NK: Key, EK: Key, T: SchemaExt<NK, EK>,

Source§

fn migrate( g: TypedGraph<NK, EK, T>, ) -> Result<TypedGraph<NK, EK, T>, TypedError<NK, EK, String, String>>

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> 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.