Struct AlternateUrl
pub struct AlternateUrl { /* private fields */ }Expand description
An alternate URL with an optional hreflang tag.
Implementations§
§impl AlternateUrl
impl AlternateUrl
pub fn new(value: impl AsRef<str>) -> Result<AlternateUrl, CanonicalValueError>
pub fn new(value: impl AsRef<str>) -> Result<AlternateUrl, CanonicalValueError>
Creates an alternate URL.
§Errors
Returns [CanonicalValueError] when the URL is empty or unsupported.
pub fn with_hreflang(self, tag: HreflangTag) -> AlternateUrl
pub fn with_hreflang(self, tag: HreflangTag) -> AlternateUrl
Sets the hreflang tag.
pub const fn hreflang(&self) -> Option<&HreflangTag>
pub const fn hreflang(&self) -> Option<&HreflangTag>
Returns the optional hreflang tag.
Trait Implementations§
§impl Clone for AlternateUrl
impl Clone for AlternateUrl
§fn clone(&self) -> AlternateUrl
fn clone(&self) -> AlternateUrl
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 more§impl Debug for AlternateUrl
impl Debug for AlternateUrl
§impl PartialEq for AlternateUrl
impl PartialEq for AlternateUrl
impl Eq for AlternateUrl
impl StructuralPartialEq for AlternateUrl
Auto Trait Implementations§
impl Freeze for AlternateUrl
impl RefUnwindSafe for AlternateUrl
impl Send for AlternateUrl
impl Sync for AlternateUrl
impl Unpin for AlternateUrl
impl UnsafeUnpin for AlternateUrl
impl UnwindSafe for AlternateUrl
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