[][src]Trait flatdata::ArchiveBuilder

pub trait ArchiveBuilder: Clone {
    const NAME: &'static str;
    const SCHEMA: &'static str;

    fn new(
        storage: Rc<dyn ResourceStorage>
    ) -> Result<Self, ResourceStorageError>; }

A flatdata archive builder for serializing data.

For each archive in generated code there is a corresponding archive builder which implements this trait.

Associated Constants

const NAME: &'static str

Name of the archive associated with this archive builder.

const SCHEMA: &'static str

Schema of the archive associated with this archive builder.

Used only for debug and inspection purposes.

Loading content...

Required methods

fn new(storage: Rc<dyn ResourceStorage>) -> Result<Self, ResourceStorageError>

Creates an archive with name NAME and schema SCHEMA in the given storage for writing.

If the archive is successfully created, the storage will contain the archive and archives schema. Archive's resources need to be written separately by using the corresponding generated methods:

  • set_struct
  • set_vector
  • start_vector/finish_vector
  • start_multivector/finish_multivector.

For more information about how to write resources, cf. the coappearances example.

Loading content...

Implementors

Loading content...