pub enum DefinitionFilter {
Kind {
kind: DefinitionKind,
},
Named {
names: NameFilter,
},
Both {
kind: DefinitionKind,
names: NameFilter,
},
}
Expand description
A definition filter allows the hiding of definitions in the current module using a combination of DefinitionKind
and NameFilter
. In a similar way to name filters there are three actions:
- Apply to all definitions of
Kind
. - Apply to all definitions
Named
according to a name filter. - Apply to all definitions where
Both
the kind and name filter match.
{
"definition_filter": [
{
"both": {
"kind": "enum",
"names": {
"matches": "_AC$"
}
}
}
]
}
use regex::Regex;
use sdml_generate::draw::filter::{
DefinitionFilter, DefinitionKind, DiagramContentFilter
};
let filter = DiagramContentFilter::default()
.with_definition_filter(
DefinitionFilter::Both {
kind: DefinitionKind::Enum,
names: Regex::new("_AC$").unwrap().into(),
}
);
Variants§
Implementations§
Source§impl DefinitionFilter
impl DefinitionFilter
Sourcepub fn exclude_named<F>(names: F) -> Selfwhere
F: Into<NameFilter>,
pub fn exclude_named<F>(names: F) -> Selfwhere
F: Into<NameFilter>,
Constructor for a filter based on a NameFilter
.
Sourcepub fn exclude_datatypes() -> Self
pub fn exclude_datatypes() -> Self
Constructor for a filter that excludes all datatype definitions.
Sourcepub fn exclude_entities() -> Self
pub fn exclude_entities() -> Self
Constructor for a filter that excludes all entity definitions.
Sourcepub fn exclude_enums() -> Self
pub fn exclude_enums() -> Self
Constructor for a filter that excludes all enum definitions.
Sourcepub fn exclude_events() -> Self
pub fn exclude_events() -> Self
Constructor for a filter that excludes all event definitions.
Sourcepub fn exclude_properties() -> Self
pub fn exclude_properties() -> Self
Constructor for a filter that excludes all property definitions.
Sourcepub fn exclude_rdfs() -> Self
pub fn exclude_rdfs() -> Self
Constructor for a filter that excludes all rdf definitions.
Sourcepub fn exclude_structures() -> Self
pub fn exclude_structures() -> Self
Constructor for a filter that excludes all structure definitions.
Sourcepub fn exclude_typeclasses() -> Self
pub fn exclude_typeclasses() -> Self
Constructor for a filter that excludes all type-class definitions.
Sourcepub fn exclude_unions() -> Self
pub fn exclude_unions() -> Self
Constructor for a filter that excludes all union definitions.
Sourcepub fn exclude_datatypes_named_named<F>(names: F) -> Selfwhere
F: Into<NameFilter>,
pub fn exclude_datatypes_named_named<F>(names: F) -> Selfwhere
F: Into<NameFilter>,
Constructor for a filter that excludes any datatype definition that match the provided NameFilter
.
Sourcepub fn exclude_entities_named<F>(names: F) -> Selfwhere
F: Into<NameFilter>,
pub fn exclude_entities_named<F>(names: F) -> Selfwhere
F: Into<NameFilter>,
Constructor for a filter that excludes any entity definition that match the provided NameFilter
.
Sourcepub fn exclude_enums_named<F>(names: F) -> Selfwhere
F: Into<NameFilter>,
pub fn exclude_enums_named<F>(names: F) -> Selfwhere
F: Into<NameFilter>,
Constructor for a filter that excludes any enum definition that match the provided NameFilter
.
Sourcepub fn exclude_events_named<F>(names: F) -> Selfwhere
F: Into<NameFilter>,
pub fn exclude_events_named<F>(names: F) -> Selfwhere
F: Into<NameFilter>,
Constructor for a filter that excludes any event definition that match the provided NameFilter
.
Sourcepub fn exclude_properties_named<F>(names: F) -> Selfwhere
F: Into<NameFilter>,
pub fn exclude_properties_named<F>(names: F) -> Selfwhere
F: Into<NameFilter>,
Constructor for a filter that excludes any property definition that match the provided NameFilter
.
Sourcepub fn exclude_rdfs_named<F>(names: F) -> Selfwhere
F: Into<NameFilter>,
pub fn exclude_rdfs_named<F>(names: F) -> Selfwhere
F: Into<NameFilter>,
Constructor for a filter that excludes any rdf definition that match the provided NameFilter
.
Sourcepub fn exclude_structures_named<F>(names: F) -> Selfwhere
F: Into<NameFilter>,
pub fn exclude_structures_named<F>(names: F) -> Selfwhere
F: Into<NameFilter>,
Constructor for a filter that excludes any structure definition that match the provided NameFilter
.
Sourcepub fn exclude_typeclasses_named<F>(names: F) -> Selfwhere
F: Into<NameFilter>,
pub fn exclude_typeclasses_named<F>(names: F) -> Selfwhere
F: Into<NameFilter>,
Constructor for a filter that excludes any type-class definition that match the provided NameFilter
.
Sourcepub fn exclude_unions_named<F>(names: F) -> Selfwhere
F: Into<NameFilter>,
pub fn exclude_unions_named<F>(names: F) -> Selfwhere
F: Into<NameFilter>,
Constructor for a filter that excludes any union definition that match the provided NameFilter
.
Sourcepub fn is_excluded(&self, defn: &Definition) -> bool
pub fn is_excluded(&self, defn: &Definition) -> bool
Returns true
if the definition defn
is excluded, else false
.
Sourcepub fn is_excluded_pair(
&self,
subject_kind: DefinitionKind,
subject_id: &Identifier,
) -> bool
pub fn is_excluded_pair( &self, subject_kind: DefinitionKind, subject_id: &Identifier, ) -> bool
Returns true
if a definition of subject_kind
and name subject_id
is excluded, else false
.
Trait Implementations§
Source§impl Clone for DefinitionFilter
impl Clone for DefinitionFilter
Source§fn clone(&self) -> DefinitionFilter
fn clone(&self) -> DefinitionFilter
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more