pub enum TextOrUri {
Uri(Uri),
Text(String),
}Expand description
A value that is a URI or free-form text, used by the RELATED, UID, KEY and SOCIALPROFILE properties.
The URI form is the default, and the text form is written with VALUE=text.
Variants§
Uri(Uri)
A URI value, which is the default form.
Text(String)
A free-form text value, written with VALUE=text.
Implementations§
Source§impl TextOrUri
impl TextOrUri
Sourcepub fn from_uuid_str(s: &str) -> Result<Self, InvalidValueError>
pub fn from_uuid_str(s: &str) -> Result<Self, InvalidValueError>
Creates a urn:uuid: URI value from a UUID string, which is useful for the UID property.
Trait Implementations§
impl Eq for TextOrUri
Source§impl PropertyValue for TextOrUri
impl PropertyValue for TextOrUri
Source§fn write_value(&self, w: &mut FoldingWriter<'_>) -> Result
fn write_value(&self, w: &mut FoldingWriter<'_>) -> Result
Writes the value part of the content line, applying any escaping the value type needs.
Source§fn explicit_value_type(&self) -> Option<&'static str>
fn explicit_value_type(&self) -> Option<&'static str>
Returns the VALUE parameter to write when this value is not the default type of the property.
Source§fn parse_value(
raw: &str,
value_type: Option<&str>,
) -> Result<Self, InvalidValueError>
fn parse_value( raw: &str, value_type: Option<&str>, ) -> Result<Self, InvalidValueError>
Parses the raw value text of a content line, guided by the lowercase VALUE parameter if one exists.
impl StructuralPartialEq for TextOrUri
Auto Trait Implementations§
impl Freeze for TextOrUri
impl RefUnwindSafe for TextOrUri
impl Send for TextOrUri
impl Sync for TextOrUri
impl Unpin for TextOrUri
impl UnsafeUnpin for TextOrUri
impl UnwindSafe for TextOrUri
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more