#[non_exhaustive]pub enum TemplateComponent {
Contributor(TemplateContributor),
Date(TemplateDate),
Title(TemplateTitle),
Number(TemplateNumber),
Variable(TemplateVariable),
Group(TemplateGroup),
Term(TemplateTerm),
}Expand description
A template component - the building blocks of citation/bibliography templates.
Each variant handles a specific data type with appropriate formatting options.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Contributor(TemplateContributor)
Date(TemplateDate)
Title(TemplateTitle)
Number(TemplateNumber)
Variable(TemplateVariable)
Group(TemplateGroup)
Term(TemplateTerm)
Implementations§
Source§impl TemplateComponent
impl TemplateComponent
Sourcepub fn rendering(&self) -> &Rendering
pub fn rendering(&self) -> &Rendering
Return the rendering options for this component.
Every template component has rendering options like emphasis, wrapping, and prefixes.
Sourcepub fn rendering_mut(&mut self) -> &mut Rendering
pub fn rendering_mut(&mut self) -> &mut Rendering
Return the mutable rendering options for this component.
Provides mutable access to rendering fields (prefix, suffix, etc.) that are present on all template component variants.
Trait Implementations§
Source§impl Clone for TemplateComponent
impl Clone for TemplateComponent
Source§fn clone(&self) -> TemplateComponent
fn clone(&self) -> TemplateComponent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ComponentValues for TemplateComponent
impl ComponentValues for TemplateComponent
Source§fn values<F: OutputFormat<Output = String>>(
&self,
reference: &Reference,
hints: &ProcHints,
options: &RenderOptions<'_>,
) -> Option<ProcValues<F::Output>>
fn values<F: OutputFormat<Output = String>>( &self, reference: &Reference, hints: &ProcHints, options: &RenderOptions<'_>, ) -> Option<ProcValues<F::Output>>
Resolve the component into processed render values for one reference.
Source§impl Debug for TemplateComponent
impl Debug for TemplateComponent
Source§impl Default for TemplateComponent
impl Default for TemplateComponent
Source§fn default() -> TemplateComponent
fn default() -> TemplateComponent
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for TemplateComponent
impl<'de> Deserialize<'de> for TemplateComponent
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TemplateComponent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TemplateComponent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TemplateComponent
impl PartialEq for TemplateComponent
Source§fn eq(&self, other: &TemplateComponent) -> bool
fn eq(&self, other: &TemplateComponent) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TemplateComponent
impl Serialize for TemplateComponent
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for TemplateComponent
Auto Trait Implementations§
impl Freeze for TemplateComponent
impl RefUnwindSafe for TemplateComponent
impl Send for TemplateComponent
impl Sync for TemplateComponent
impl Unpin for TemplateComponent
impl UnsafeUnpin for TemplateComponent
impl UnwindSafe for TemplateComponent
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