pub struct DiagramContentFilter { /* private fields */ }
Expand description
A content filter is created to determine elements of a module to exclude from a diagram. For example, you may wish to create a diagram with only structures and create associations for only target types which are also structures.
Implementations§
Source§impl DiagramContentFilter
impl DiagramContentFilter
Sourcepub fn with_module_import_filter(self, filter: NameFilter) -> Self
pub fn with_module_import_filter(self, filter: NameFilter) -> Self
Builder function to set the module import filter.
Sourcepub fn filter_stdlib_imports(self) -> Self
pub fn filter_stdlib_imports(self) -> Self
Builder function to set the module import filter to exclude all standard library modules.
Sourcepub fn with_member_import_filter<F>(self, filter: F) -> Selfwhere
F: Into<QualifiedNameFilter>,
pub fn with_member_import_filter<F>(self, filter: F) -> Selfwhere
F: Into<QualifiedNameFilter>,
Builder function to set the member import filter.
Sourcepub fn with_annotation_filter<F>(self, filter: F) -> Selfwhere
F: Into<QualifiedNameFilter>,
pub fn with_annotation_filter<F>(self, filter: F) -> Selfwhere
F: Into<QualifiedNameFilter>,
Builder function to set the annotation filter.
Sourcepub fn with_definition_filter<F>(self, filter: F) -> Selfwhere
F: Into<DefinitionFilter>,
pub fn with_definition_filter<F>(self, filter: F) -> Selfwhere
F: Into<DefinitionFilter>,
Builder function to set the definition filter.
Sourcepub fn with_definition_filters(self, filter: Vec<DefinitionFilter>) -> Self
pub fn with_definition_filters(self, filter: Vec<DefinitionFilter>) -> Self
Builder function to set the definition filter.
Sourcepub fn with_association_filter<F>(self, filter: F) -> Selfwhere
F: Into<DefinitionFilter>,
pub fn with_association_filter<F>(self, filter: F) -> Selfwhere
F: Into<DefinitionFilter>,
Builder function to set the association filter.
Sourcepub fn with_association_filters(self, filter: Vec<DefinitionFilter>) -> Self
pub fn with_association_filters(self, filter: Vec<DefinitionFilter>) -> Self
Builder function to set the association filter.
pub fn draw_import(&self, id: &Import) -> bool
Sourcepub fn draw_module_import(&self, id: &Identifier) -> bool
pub fn draw_module_import(&self, id: &Identifier) -> bool
Returns true
if the diagram should draw an import relationship to the module named
id
, else false
.
Sourcepub fn draw_member_import(&self, id: &QualifiedIdentifier) -> bool
pub fn draw_member_import(&self, id: &QualifiedIdentifier) -> bool
Returns true
if the diagram should draw an import relationship to the member named
id
, else false
.
Sourcepub fn draw_member_import_pair(
&self,
nsid: &Identifier,
id: &Identifier,
) -> bool
pub fn draw_member_import_pair( &self, nsid: &Identifier, id: &Identifier, ) -> bool
Returns true
if the diagram should draw an import relationship to the module named
id
in module nsid
, else false
.
Sourcepub fn draw_definition(&self, defn: &Definition) -> bool
pub fn draw_definition(&self, defn: &Definition) -> bool
Returns true
if the diagram should draw the definition defn
, else false
.
pub fn draw_definition_named( &self, subject_kind: DefinitionKind, subject_id: &Identifier, ) -> bool
Sourcepub fn draw_member_as_association(&self, defn: &Definition) -> bool
pub fn draw_member_as_association(&self, defn: &Definition) -> bool
Returns true
if the diagram should draw a member as an association
(or attribute) depending on it’s target type, else false
.
Sourcepub fn write_to_file<P>(&self, file: P) -> Result<(), Error>
pub fn write_to_file<P>(&self, file: P) -> Result<(), Error>
Write this filter to the file named file
in JSON format.
Sourcepub fn write_to_writer<W>(&self, writer: W) -> Result<(), Error>where
W: Write,
pub fn write_to_writer<W>(&self, writer: W) -> Result<(), Error>where
W: Write,
Write this filter to the provided writer in JSON format.
Sourcepub fn read_from_file<P>(file: P) -> Result<Self, Error>
pub fn read_from_file<P>(file: P) -> Result<Self, Error>
Read a filter from the file named file
in JSON format.
Sourcepub fn read_from_reader<R>(reader: R) -> Result<Self, Error>where
R: Read,
pub fn read_from_reader<R>(reader: R) -> Result<Self, Error>where
R: Read,
Read a filter from the provided reader in JSON format.
Trait Implementations§
Source§impl Clone for DiagramContentFilter
impl Clone for DiagramContentFilter
Source§fn clone(&self) -> DiagramContentFilter
fn clone(&self) -> DiagramContentFilter
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more