pub enum PropertyNameV0 {
Standard(StandardPropertyNamePayloadV0),
Custom(CustomPropertyNamePayloadV0),
}Expand description
A CSS property name with an authored spelling and one sealed canonical identity.
Structural equality is deliberately unavailable. Callers compare property
identity through PropertyNameV0::same_as or carry the sealed key returned by
PropertyNameV0::canonical_key.
ⓘ
use omena_syntax::ident::{PropertyNameKindV0, PropertyNameV0};
fn raw_structural_equality(left: &PropertyNameV0, right: &PropertyNameV0) -> bool {
left == right
}
let _ = PropertyNameV0::new("color", PropertyNameKindV0::Standard);ⓘ
use omena_syntax::ident::PropertyNameV0;
let property = PropertyNameV0::custom("--token");
let _ = property.decoded();ⓘ
use omena_syntax::ident::PropertyNameV0;
let property = PropertyNameV0::custom("--token");
let PropertyNameV0::Custom(payload) = property else { unreachable!() };
let _ = payload.decoded;Variants§
Implementations§
Source§impl PropertyNameV0
impl PropertyNameV0
Classifies a property name after CSS-escape decoding, then applies the corresponding canonical identity rules.
pub fn new(authored: impl Into<String>, kind: PropertyNameKindV0) -> Self
pub fn standard(authored: impl Into<String>) -> Self
pub fn custom(authored: impl Into<String>) -> Self
pub fn kind(&self) -> PropertyNameKindV0
pub fn canonical_name(&self) -> &str
pub fn same_as(&self, other: &Self) -> bool
pub fn canonical_key(&self) -> CanonicalPropertyKeyV0
pub fn as_custom_key(&self) -> Option<CanonicalCustomPropertyNameV0>
pub fn as_standard_key(&self) -> Option<&CanonicalStandardPropertyNameV0>
pub fn canonical_custom_key( authored: impl Into<String>, ) -> CanonicalCustomPropertyNameV0
pub fn canonical_standard_key( authored: impl Into<String>, ) -> CanonicalStandardPropertyNameV0
Trait Implementations§
Source§impl Clone for PropertyNameV0
impl Clone for PropertyNameV0
Source§fn clone(&self) -> PropertyNameV0
fn clone(&self) -> PropertyNameV0
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 moreAuto Trait Implementations§
impl Freeze for PropertyNameV0
impl RefUnwindSafe for PropertyNameV0
impl Send for PropertyNameV0
impl Sync for PropertyNameV0
impl Unpin for PropertyNameV0
impl UnsafeUnpin for PropertyNameV0
impl UnwindSafe for PropertyNameV0
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