referrerpolicy=no-referrer-when-downgrade
cumulus_primitives_core

Trait Reanchorable

pub trait Reanchorable: Sized {
    type Error: Debug;

    // Required methods
    fn reanchor(
        &mut self,
        target: &Location,
        context: &Junctions,
    ) -> Result<(), ()>;
    fn reanchored(
        self,
        target: &Location,
        context: &Junctions,
    ) -> Result<Self, Self::Error>;
}

Required Associated Types§

type Error: Debug

Type to return in case of an error.

Required Methods§

fn reanchor(&mut self, target: &Location, context: &Junctions) -> Result<(), ()>

Mutate self so that it represents the same location from the point of view of target. The context of self is provided as context.

Does not modify self in case of overflow.

fn reanchored( self, target: &Location, context: &Junctions, ) -> Result<Self, Self::Error>

Consume self and return a new value representing the same location from the point of view of target. The context of self is provided as context.

Returns the original self in case of overflow.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§