pub struct ExplicitNameBuilder(/* private fields */);Expand description
A more explicit version of NameBuilder that does not add or remove any
suffixes or prefixes from the generated name. This may lead to duplicated
strings inside the generated name (like FuuTypeType), but is will reduce
naming conflicts in most cases.
Implementations§
Source§impl ExplicitNameBuilder
impl ExplicitNameBuilder
Sourcepub fn new(id: Arc<AtomicUsize>, naming: Box<dyn NamingTrait>) -> Self
pub fn new(id: Arc<AtomicUsize>, naming: Box<dyn NamingTrait>) -> Self
Create a new ExplicitNameBuilder instance.
The passed id is used to generate unique ids for unnamed types.
Trait Implementations§
Source§impl Clone for ExplicitNameBuilder
impl Clone for ExplicitNameBuilder
Source§fn clone(&self) -> ExplicitNameBuilder
fn clone(&self) -> ExplicitNameBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExplicitNameBuilder
impl Debug for ExplicitNameBuilder
Source§impl NameBuilder for ExplicitNameBuilder
impl NameBuilder for ExplicitNameBuilder
Source§fn finish(&self) -> Name
fn finish(&self) -> Name
Finish the current name building and create a
Name from the known
information.Source§fn merge(&mut self, other: &dyn NameBuilderTrait)
fn merge(&mut self, other: &dyn NameBuilderTrait)
Merge the data of the
other name builder into the current name builder.
The passed name builder is of the same type then the current one.Source§fn clone_boxed(&self) -> Box<dyn NameBuilderTrait>
fn clone_boxed(&self) -> Box<dyn NameBuilderTrait>
Create a clone of the current builder and return it as box.
Source§fn has_extension(&self) -> bool
fn has_extension(&self) -> bool
Returns
true if this builder has at least on extension set, false otherwise.Source§fn set_with_id(&mut self, value: bool)
fn set_with_id(&mut self, value: bool)
Instruct the builder to add a unique id to the generated name or not.
Source§fn set_generated(&mut self, value: bool)
fn set_generated(&mut self, value: bool)
Instruct the builder to generated a
Name::Generated if true is passed,
or a Name::Named if false is passed.Source§fn add_extension(&mut self, replace: bool, extension: String)
fn add_extension(&mut self, replace: bool, extension: String)
Add a new
extension to the builder. If replace is set to true, any previous
extension is dropped.Source§fn strip_suffix(&mut self, suffix: &str)
fn strip_suffix(&mut self, suffix: &str)
Remove the specified
suffix from the name and the extensions.Source§fn generate_unique_id(&mut self)
fn generate_unique_id(&mut self)
Force the builder to generate a unique id, that is later used to generate
the name. Read more
Source§fn prepare_type_name(&mut self)
fn prepare_type_name(&mut self)
Prepare the builder to create a type name.
Source§fn prepare_field_name(&mut self)
fn prepare_field_name(&mut self)
Prepare the builder to create a field name.
Source§fn prepare_content_type_name(&mut self)
fn prepare_content_type_name(&mut self)
Prepare the builder to create a content type name.
Auto Trait Implementations§
impl Freeze for ExplicitNameBuilder
impl !RefUnwindSafe for ExplicitNameBuilder
impl !Send for ExplicitNameBuilder
impl !Sync for ExplicitNameBuilder
impl Unpin for ExplicitNameBuilder
impl UnsafeUnpin for ExplicitNameBuilder
impl !UnwindSafe for ExplicitNameBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<X> NameBuilderExt for Xwhere
X: NameBuilder,
impl<X> NameBuilderExt for Xwhere
X: NameBuilder,
Source§fn generate_id(self) -> X
fn generate_id(self) -> X
Force the builder to generate a unique id.
Source§fn with_id(self, value: bool) -> X
fn with_id(self, value: bool) -> X
Tell the builder to add (
true) or not to add (false) the unique id
to the generated name.Source§fn extend<I>(self, replace: bool, iter: I) -> X
fn extend<I>(self, replace: bool, iter: I) -> X
Add extensions to the builder using the passed iterator
iter. If replace
is set to true any existing extension is dropped before the new ones are
applied.Source§fn remove_suffix(self, suffix: &str) -> X
fn remove_suffix(self, suffix: &str) -> X
Remove the specified
suffix from the builder.Source§fn unique_name<T>(self, value: T) -> Xwhere
T: Display,
fn unique_name<T>(self, value: T) -> Xwhere
T: Display,
Instruct the builder to create a unique name from the passed
value. Read moreInstruct the builder to create a name that is shared between different parts
of the code from the passed
value. Read moreSource§fn or<T>(self, fallback: T) -> Xwhere
T: NameFallback,
fn or<T>(self, fallback: T) -> Xwhere
T: NameFallback,
If the builder does currently not have a name, the passed
fallback is applied.Source§fn or_else<F, T>(self, fallback: F) -> Xwhere
F: FnOnce() -> T,
T: NameFallback,
fn or_else<F, T>(self, fallback: F) -> Xwhere
F: FnOnce() -> T,
T: NameFallback,
If the builder does currently not have a name, the passed
fallback is applied.Source§fn field_name(self) -> X
fn field_name(self) -> X
Prepare the builder to create a field name.
Source§fn content_type_name(self) -> X
fn content_type_name(self) -> X
Prepare the builder to create a content type name.