Skip to main content

GitElement

Trait GitElement 

Source
pub trait GitElement: Sized {
    // Required methods
    fn read(structure: &GffStruct) -> Self;
    fn write(&self, id: i32) -> GffStruct;
}
Expand description

One arm’s element codec, so a list can read or write either side without naming which.

Both halves are what the derive already generates for a list element; this only gives the two arms one name so the list can be generic over them.

Required Methods§

Source

fn read(structure: &GffStruct) -> Self

Reads one element.

Source

fn write(&self, id: i32) -> GffStruct

Writes one element into a struct carrying the list’s own id.

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§