Trait ProjectMut

Source
pub trait ProjectMut<'reference, Weight, MutationListener>
where Weight: Element, MutationListener: MutationListener<'reference, Weight>, Self: Sized,
{ // Required method fn project_mut( weight: &'reference mut Weight, mutation_listener: MutationListener, ) -> Option<Self>; }
Expand description

Enables projecting a graph element weight to a mutable specific type.

This trait provides a mechanism to safely convert a generic graph element (vertex or edge) to a specific, strongly-typed mutable representation. Changes to the projected type will be tracked using the mutation listener.

§Type Parameters

  • 'reference: The lifetime of the mutable reference to the weight
  • Weight: The type of the element weight being projected
  • MutationListener: A type that listens for mutations to track index updates

Required Methods§

Source

fn project_mut( weight: &'reference mut Weight, mutation_listener: MutationListener, ) -> Option<Self>

Attempts to convert a weight to this specific mutable type.

§Parameters
  • weight: The element weight to project
  • mutation_listener: The listener that will track mutations to the weight
§Returns

Some(Self) if the weight can be projected to this type, None otherwise.

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§