Struct stam::AnnotationStoreBuilder
source · pub struct AnnotationStoreBuilder<'a> { /* private fields */ }Implementations§
source§impl<'a> AnnotationStoreBuilder<'a>
impl<'a> AnnotationStoreBuilder<'a>
sourcepub fn new() -> Self
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.
sourcepub fn with_id(self, id: String) -> Self
pub fn with_id(self, id: String) -> Self
Set the public ID for the AnnotationStore that will be built.
sourcepub fn with_annotationset(
self,
annotationset: AnnotationDataSetBuilder<'a>
) -> Self
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.
sourcepub fn with_annotationsets(
self,
annotationsets: Vec<AnnotationDataSetBuilder<'a>>
) -> Self
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.
sourcepub fn with_resource(self, resource: TextResourceBuilder) -> Self
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.
sourcepub fn with_resources(self, resources: Vec<TextResourceBuilder>) -> Self
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.
sourcepub fn with_annotation(self, annotation: AnnotationBuilder<'a>) -> Self
pub fn with_annotation(self, annotation: AnnotationBuilder<'a>) -> Self
Adds an annotation builder, can be called multiple times.
sourcepub fn with_annotations(self, annotations: Vec<AnnotationBuilder<'a>>) -> Self
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.
sourcepub fn with_filename(self, filename: &str) -> Self
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.
pub fn with_config(self, config: Config) -> Self
sourcepub fn build(self) -> Result<AnnotationStore, StamError>
pub fn build(self) -> Result<AnnotationStore, StamError>
Builds a new annotation store from [`AnnotationStoreBuilder’].