pub struct AnnotationStoreBuilder<'a> { /* private fields */ }

Implementations§

source§

impl<'a> AnnotationStoreBuilder<'a>

source

pub fn new() -> Self

Start a new AnnotationStoreBuilder to build an AnnotationStore. Chain various with_*() methods and call build() in the end fo produce the actual AnnotationStore.

source

pub fn with_id(self, id: String) -> Self

Set the public ID for the AnnotationStore that will be built.

source

pub fn with_annotationset( self, annotationset: AnnotationDataSetBuilder<'a> ) -> Self

Add an AnnotationDataSet to the store (in the form of a builder). Can be called multiple times.

source

pub fn with_annotationsets( self, annotationsets: Vec<AnnotationDataSetBuilder<'a>> ) -> Self

Adds multiple annotation sets at once, this can only be called once as it will overwrite existing builders.

source

pub fn with_resource(self, resource: TextResourceBuilder) -> Self

Add an TextResource to the store (in the form of a builder). Can be called multiple times.

source

pub fn with_resources(self, resources: Vec<TextResourceBuilder>) -> Self

Adds multiple resource builders at once, this can only be called once as it will overwrite existing builders.

source

pub fn with_annotation(self, annotation: AnnotationBuilder<'a>) -> Self

Adds an annotation builder, can be called multiple times.

source

pub fn with_annotations(self, annotations: Vec<AnnotationBuilder<'a>>) -> Self

Adds multiple annotation builders, this can only be called once as it will overwrite existing annotation builders.

source

pub fn with_filename(self, filename: &str) -> Self

Set the filename for the AnnotationStore that will be built. This does not load from file. Use AnnotationStore::from_file() instead of this builder if that’s what you want.

source

pub fn with_config(self, config: Config) -> Self

source

pub fn build(self) -> Result<AnnotationStore, StamError>

Builds a new annotation store from [`AnnotationStoreBuilder’].

Trait Implementations§

source§

impl<'a> Default for AnnotationStoreBuilder<'a>

source§

fn default() -> AnnotationStoreBuilder<'a>

Returns the “default value” for a type. Read more
source§

impl<'de, 'a> Deserialize<'de> for AnnotationStoreBuilder<'a>

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<'c, 'a> FromCsv<'c> for AnnotationStoreBuilder<'a>

source§

fn from_csv_reader( reader: Box<dyn BufRead>, filename: Option<&str>, config: Config ) -> Result<Self, StamError>

source§

fn from_csv_file(filename: &str, config: Config) -> Result<Self, StamError>

source§

impl<'j, 'a> FromJson<'j> for AnnotationStoreBuilder<'a>

source§

fn from_json_file(filename: &str, config: Config) -> Result<Self, StamError>

Loads an AnnotationStore from a STAM JSON file The file must contain a single object which has “@type”: “AnnotationStore”

source§

fn from_json_str(string: &str, config: Config) -> Result<Self, StamError>

Loads an AnnotationStore from a STAM JSON string The string must contain a single object which has “@type”: “AnnotationStore”

source§

impl<'a> TryFrom<AnnotationStoreBuilder<'a>> for AnnotationStore

§

type Error = StamError

The type returned in the event of a conversion error.
source§

fn try_from(builder: AnnotationStoreBuilder<'_>) -> Result<Self, StamError>

Performs the conversion.
source§

impl<'a> TypeInfo for AnnotationStoreBuilder<'a>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,