ical-rs 0.5.1

iCalendar parser, validator, editor, merger and builder library
Documentation
//! # URI value
//!
//! The decoded URI value kind.
//!
//! Backs every RFC 5545 property whose value is a URI (RFC 5545 3.3.13): `URL`,
//! `TZURL`, `SOURCE`, `CONFERENCE`, `ATTACH` and `IMAGE` (when a URI), and
//! `STYLED-DESCRIPTION`. The reference is kept verbatim as a string; the crate
//! does not parse or validate it.

use alloc::{borrow::Cow, string::String};

/// A decoded URI value, kept verbatim.
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct IcalUri<'a>(pub Cow<'a, str>);

impl<'a> From<&'a str> for IcalUri<'a> {
    fn from(value: &'a str) -> Self {
        Self(Cow::Borrowed(value))
    }
}

impl From<String> for IcalUri<'_> {
    fn from(value: String) -> Self {
        Self(Cow::Owned(value))
    }
}

impl<'a> From<Cow<'a, str>> for IcalUri<'a> {
    fn from(value: Cow<'a, str>) -> Self {
        Self(value)
    }
}