Struct stam::Config

source ·
pub struct Config { /* private fields */ }
Expand description

This holds the configuration. It is not limited to configuring a single part of the model, but unifies all in a single configuration.

Implementations§

source§

impl Config

source

pub fn new() -> Self

source

pub fn with_textrelationmap(self, value: bool) -> Self

Enable/disable the reverse index for text, it maps TextResource => TextSelection => Annotation Do not change this on a configuration that is already in use!

source

pub fn textrelationmap(&self) -> bool

Is the reverse index for text enabled? It maps TextResource => TextSelection => Annotation

source

pub fn with_resource_annotation_map(self, value: bool) -> Self

Enable/disable reverse index for TextResource => Annotation. Holds only annotations that directly reference the TextResource (via crate::Selector::ResourceSelector), i.e. metadata Do not change this on a configuration that is already in use!

source

pub fn resource_annotation_map(&self) -> bool

Is the reverse index for TextResource => Annotation enabled? Holds only annotations that directly reference the TextResource (via crate::Selector::ResourceSelector), i.e. metadata

source

pub fn with_dataset_annotation_map(self, value: bool) -> Self

Enable/disable reverse index for AnnotationDataSet => Annotation. Holds only annotations that directly reference the AnnotationDataSet (via crate::Selector::DataSetSelector), i.e. metadata Do not change this on a configuration that is already in use!

source

pub fn dataset_annotation_map(&self) -> bool

Is the reverse index for AnnotationDataSet => Annotation enabled?. Holds only annotations that directly reference the AnnotationDataSet (via crate::Selector::DataSetSelector), i.e. metadata

source

pub fn with_annotation_annotation_map(self, value: bool) -> Self

Enable/disable index for annotations that reference other annotations Do not change this on a configuration that is already in use!

source

pub fn annotation_annotation_map(&self) -> bool

Is the index for annotations that reference other annotations enabled?

source

pub fn with_dataformat(self, value: DataFormat) -> Self

Sets chosen dataformat for serialisation, defaults to STAM JSON. Do not change this on a configuration that is already in use! Use [AnnotationStore.set_filename()] instead.

source

pub fn dataformat(&self) -> DataFormat

Returns the configured dataformat for serialisation.

source

pub fn with_generate_ids(self, value: bool) -> Self

Generate public IDs when missing.

source

pub fn generate_ids(&self) -> bool

Is generation of public IDs when missing enabled or not?

source

pub fn with_use_include(self, value: bool) -> Self

Use @include mechanism for STAM JSON, or output all to a single file?

source

pub fn use_include(&self) -> bool

Use @include mechanism for STAM JSON, or output all to a single file?

source

pub fn with_milestone_interval(self, value: usize) -> Self

Set the configured milestone interval The Milestone placement interval (in unicode codepoints) is used in indexing text resources. A low number above zero increases search performance at the cost of memory and increased initialisation time.

source

pub fn milestone_interval(&self) -> usize

Return the configured milestone interval The Milestone placement interval (in unicode codepoints) is used in indexing text resources. A low number above zero increases search performance at the cost of memory and increased initialisation time.

source

pub fn with_debug(self, value: bool) -> Self

Enable or disable debug mode. In debug mode, verbose output will be printed to standard error output

source

pub fn debug(&self) -> bool

Is debug mode enabled or not?

source

pub fn workdir(&self) -> Option<&Path>

Return the working directory, if set

source

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

Loads configuration from a JSON file

Trait Implementations§

source§

impl Clone for Config

source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Config

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Config

source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for Config

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 Serialize for Config

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl ToJson for Config

source§

fn to_json_writer<W>(&self, writer: W, compact: bool) -> Result<(), StamError>where W: Write,

Writes a serialisation (choose a dataformat) to any writer Lower-level function
source§

fn to_json_file(&self, filename: &str, config: &Config) -> Result<(), StamError>

Writes this structure to a file The actual dataformat can be set via config, the default is STAM JSON.
source§

fn to_json_string(&self, config: &Config) -> Result<String, StamError>

Serializes this structure to one string. The actual dataformat can be set via config, the default is STAM JSON. If config not not specified, an attempt to fetch the AnnotationStore’s initial config is made
source§

impl TypeInfo for Config

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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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>,