Skip to main content

Fork

Trait Fork 

pub trait Fork: Sized {
    // Required method
    fn fork(&self) -> Self;
}
Expand description

Create a structurally isolated logical child of a value.

Fork is similar to Clone, but allows a type to isolate structural or append-only state that must not be shared between independent attempts. Implementations should preserve the observable input and document which mutations are isolated. Values intentionally shared through handles such as Arc may still expose shared interior mutability.

Required Methods§

fn fork(&self) -> Self

Create a structurally isolated logical child of this value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§