pub enum TemplateVariant {
Full(Vec<TemplateComponent>),
Diff(TemplateVariantDiff),
}Expand description
Type-specific template override, either as a complete legacy template or a V3 diff.
Variants§
Full(Vec<TemplateComponent>)
Complete replacement template used by Template V1/V2 styles.
Diff(TemplateVariantDiff)
Structural diff applied to a parent template during style resolution.
Implementations§
Source§impl TemplateVariant
impl TemplateVariant
Sourcepub fn as_template(&self) -> Option<&[TemplateComponent]>
pub fn as_template(&self) -> Option<&[TemplateComponent]>
Return this variant as a concrete template if it has already been resolved.
Sourcepub fn as_template_mut(&mut self) -> Option<&mut Vec<TemplateComponent>>
pub fn as_template_mut(&mut self) -> Option<&mut Vec<TemplateComponent>>
Return this variant as a mutable concrete template if it has already been resolved.
Sourcepub fn into_template(self) -> Option<Vec<TemplateComponent>>
pub fn into_template(self) -> Option<Vec<TemplateComponent>>
Convert this variant into its concrete template if it has already been resolved.
Trait Implementations§
Source§impl Clone for TemplateVariant
impl Clone for TemplateVariant
Source§fn clone(&self) -> TemplateVariant
fn clone(&self) -> TemplateVariant
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 Debug for TemplateVariant
impl Debug for TemplateVariant
Source§impl<'de> Deserialize<'de> for TemplateVariant
impl<'de> Deserialize<'de> for TemplateVariant
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TemplateVariant, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TemplateVariant, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Vec<TemplateComponent>> for TemplateVariant
impl From<Vec<TemplateComponent>> for TemplateVariant
Source§fn from(template: Vec<TemplateComponent>) -> TemplateVariant
fn from(template: Vec<TemplateComponent>) -> TemplateVariant
Converts to this type from the input type.
Source§impl PartialEq for TemplateVariant
impl PartialEq for TemplateVariant
Source§fn eq(&self, other: &TemplateVariant) -> bool
fn eq(&self, other: &TemplateVariant) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TemplateVariant
impl Serialize for TemplateVariant
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 TemplateVariant
Auto Trait Implementations§
impl Freeze for TemplateVariant
impl RefUnwindSafe for TemplateVariant
impl Send for TemplateVariant
impl Sync for TemplateVariant
impl Unpin for TemplateVariant
impl UnsafeUnpin for TemplateVariant
impl UnwindSafe for TemplateVariant
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