pub struct AuthoredPropertyTextV0(/* private fields */);Expand description
Authored CSS property text retained only for presentation and provenance.
This type deliberately implements no structural equality, ordering, hashing,
or raw-string borrowing. Identity-bearing carriers pair it with a sealed
canonical property key and use that key for every comparison or lookup.
AuthoredPropertyTextV0::write_into and serialization are the only
presentation exits. Identity projections stay inside the property-name
authority.
ⓘ
use omena_syntax::ident::AuthoredPropertyTextV0;
struct Declaration {
property: AuthoredPropertyTextV0,
}
let left = Declaration { property: AuthoredPropertyTextV0::new("--Foo") };
let right = Declaration { property: AuthoredPropertyTextV0::new("--foo") };
let _ = left.property == right.property;ⓘ
use omena_syntax::ident::AuthoredPropertyTextV0;
struct Candidate {
name: AuthoredPropertyTextV0,
}
let left = Candidate { name: AuthoredPropertyTextV0::new("--Foo") };
let right = Candidate { name: AuthoredPropertyTextV0::new("--foo") };
let _ = left.name == right.name;ⓘ
use omena_syntax::ident::AuthoredPropertyTextV0;
let property = AuthoredPropertyTextV0::new("COLOR");
let _ = property.to_ascii_lowercase();ⓘ
use omena_syntax::ident::AuthoredPropertyTextV0;
let property = AuthoredPropertyTextV0::new("COLOR");
let _ = property.to_lowercase();ⓘ
use omena_syntax::ident::AuthoredPropertyTextV0;
let property = AuthoredPropertyTextV0::new("COLOR");
let _ = property.as_str();ⓘ
use std::collections::HashMap;
use omena_syntax::ident::AuthoredPropertyTextV0;
let mut values = HashMap::<String, usize>::new();
values.insert(AuthoredPropertyTextV0::new("--token"), 1);ⓘ
use omena_syntax::ident::AuthoredPropertyTextV0;
let property = AuthoredPropertyTextV0::new("--token");
let _ = property.to_string();ⓘ
use omena_syntax::ident::AuthoredPropertyTextV0;
let property = AuthoredPropertyTextV0::new("--token");
let _ = format!("{}", property);ⓘ
use std::fmt::Write;
use omena_syntax::ident::AuthoredPropertyTextV0;
let property = AuthoredPropertyTextV0::new("--token");
let mut output = String::new();
let _ = write!(&mut output, "{}", property);ⓘ
use std::fmt;
use omena_syntax::ident::AuthoredPropertyTextV0;
struct Shown(AuthoredPropertyTextV0);
impl fmt::Display for Shown {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(formatter, "{}", self.0)
}
}ⓘ
use omena_syntax::ident::AuthoredPropertyTextV0;
struct Carrier(AuthoredPropertyTextV0);
let mut values = vec![Carrier(AuthoredPropertyTextV0::new("--token"))];
values.sort();Implementations§
Source§impl AuthoredPropertyTextV0
impl AuthoredPropertyTextV0
pub fn new(authored: impl Into<String>) -> Self
Sourcepub fn write_into(&self, out: &mut impl Write) -> Result
pub fn write_into(&self, out: &mut impl Write) -> Result
Writes the source spelling to a presentation sink without exposing a borrowable raw string that could be reused as an identity key.
pub fn is_empty(&self) -> bool
pub fn to_property_name(&self) -> PropertyNameV0
pub fn to_custom_key(&self) -> CanonicalCustomPropertyNameV0
pub fn to_standard_key(&self) -> CanonicalStandardPropertyNameV0
Trait Implementations§
Source§impl Clone for AuthoredPropertyTextV0
impl Clone for AuthoredPropertyTextV0
Source§fn clone(&self) -> AuthoredPropertyTextV0
fn clone(&self) -> AuthoredPropertyTextV0
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 AuthoredPropertyTextV0
impl Debug for AuthoredPropertyTextV0
Source§impl<'de> Deserialize<'de> for AuthoredPropertyTextV0
impl<'de> Deserialize<'de> for AuthoredPropertyTextV0
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AuthoredPropertyTextV0
impl RefUnwindSafe for AuthoredPropertyTextV0
impl Send for AuthoredPropertyTextV0
impl Sync for AuthoredPropertyTextV0
impl Unpin for AuthoredPropertyTextV0
impl UnsafeUnpin for AuthoredPropertyTextV0
impl UnwindSafe for AuthoredPropertyTextV0
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