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

Implementations§

source§

impl<'a> AnnotationDataSetBuilder<'a>

source

pub fn new() -> Self

Start a new builder to build an AnnotationDataSet. You can chain various with_* methods and subsequently call build() to produce the actual AnnotationDataSet.

source

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

Loads an AnnotationDataSetBuilder from file (STAM JSON or other supported format). For STAM JSON, the file must contain a single object which has “@type”: “AnnotationDataSet”

source

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

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

source

pub fn with_keys(self, keys: Vec<DataKey>) -> Self

Adds multiple keys at once. This can only be called once (it will override any prior set keys)

source

pub fn with_key(self, key: DataKey) -> Self

Adds a data key. This can be called multiple times.

source

pub fn with_data_builders(self, data: Vec<AnnotationDataBuilder<'a>>) -> Self

Adds multiple data builder at once. This can only be called once (it will override any prior set keys)

source

pub fn with_data(self, data: AnnotationDataBuilder<'a>) -> Self

Adds a data builder. This can be called multiple times.

source

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

Set the filename for the AnnotationDataSet that will be built. This does not load from file. Use AnnotationDataSet::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<AnnotationDataSet, StamError>

Final builder method, constructs the [’AnnotationDataSet`], consuming the builder

Trait Implementations§

source§

impl<'a> Default for AnnotationDataSetBuilder<'a>

source§

fn default() -> AnnotationDataSetBuilder<'a>

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

impl<'de, 'a> Deserialize<'de> for AnnotationDataSetBuilder<'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 AnnotationDataSetBuilder<'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 AnnotationDataSetBuilder<'a>

source§

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

Loads an AnnotationDataSet from a STAM JSON file, as a builder The file must contain a single object which has “@type”: “AnnotationDataSet” If include is true, the file will be included via the @include mechanism, and is kept external upon serialization If workdir is set, the file will be searched for in the workdir if needed

source§

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

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

source§

impl<'a> TryFrom<AnnotationDataSetBuilder<'a>> for AnnotationDataSet

§

type Error = StamError

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

fn try_from(builder: AnnotationDataSetBuilder<'a>) -> Result<Self, StamError>

Performs the conversion.
source§

impl<'a> TypeInfo for AnnotationDataSetBuilder<'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>,