pub trait Reanchorable: Sized {
type Error: Debug;
// Required methods
fn reanchor(
&mut self,
target: &Location,
context: &InteriorLocation,
) -> Result<(), ()>;
fn reanchored(
self,
target: &Location,
context: &InteriorLocation,
) -> Result<Self, Self::Error>;
}
Required Associated Types§
Required Methods§
Sourcefn reanchor(
&mut self,
target: &Location,
context: &InteriorLocation,
) -> Result<(), ()>
fn reanchor( &mut self, target: &Location, context: &InteriorLocation, ) -> 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.
Sourcefn reanchored(
self,
target: &Location,
context: &InteriorLocation,
) -> Result<Self, Self::Error>
fn reanchored( self, target: &Location, context: &InteriorLocation, ) -> 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.