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 key_annotation_metamap(&self) -> bool

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

source

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

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

source

pub fn data_annotation_metamap(&self) -> bool

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

source

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

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

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 with_shrink_to_fit(self, value: bool) -> Self

source

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

Strip temporary public identifiers when deserialising?

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. Each will consist of 21 URL-friendly ASCII symbols after a prefix of A for Annotations, S for DataSets, D for AnnotationData, R for resources

source

pub fn generate_ids(&self) -> bool

Is generation of public IDs when missing enabled or not?

source

pub fn strip_temp_ids(&self) -> bool

Strip temporary public identifiers when deserialising?

source

pub fn shrink_to_fit(&self) -> bool

Shrink data structures for minimal memory footprint?

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<'bytes, Ctx> Decode<'bytes, Ctx> for Config

source§

fn decode( __d777: &mut Decoder<'bytes>, __ctx777: &mut Ctx ) -> Result<Config, Error>

Decode a value using the given Decoder. Read more
source§

fn nil() -> Option<Self>

If possible, return a nil value of Self. 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<Ctx> Encode<Ctx> for Config

source§

fn encode<__W777>( &self, __e777: &mut Encoder<__W777>, __ctx777: &mut Ctx ) -> Result<(), Error<__W777::Error>>
where __W777: Write,

Encode a value of this type using the given Encoder. Read more
source§

fn is_nil(&self) -> bool

Is this value of Self a nil value? 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

source§

fn typeinfo() -> Type

Return the type (introspection).
source§

fn temp_id_prefix() -> &'static str

Return the prefix for temporary identifiers of this type

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where 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 T
where 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 T
where 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 T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

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