pub struct IcalValueNode<'a> {
pub escaper: Escaper,
/* private fields */
}parser only.Expand description
A raw value: ;-separated components, each a list of ,-separated raw
value leaves.
From parse the value is held as one unsplit raw slice and
walked lazily, so a parse that never decodes and a byte-faithful reserialize
do no splitting at all. The first edit (or a model encode) splits it into
owned components, which then take over as the source of
truth. The escaper records which version’s escaping rules the codec must
apply; it is stamped from the card version after parsing (see
IcalCst::parse).
Fields§
§escaper: EscaperThe escaping rules to read and write this value with.
Implementations§
Source§impl<'a> IcalValueNode<'a>
impl<'a> IcalValueNode<'a>
Sourcepub fn parse(value: &'a [u8]) -> Self
pub fn parse(value: &'a [u8]) -> Self
Wrap a raw value, unsplit and borrowed, to be walked lazily. The colon, name and eol are the line’s business; this is only the bytes after the colon.
Sourcepub fn component_count(&self) -> usize
pub fn component_count(&self) -> usize
The number of ;-separated components (at least one, since an empty
value is one empty component).
Sourcepub fn decode_at(&self, i: usize) -> Vec<Cow<'_, str>>
pub fn decode_at(&self, i: usize) -> Vec<Cow<'_, str>>
Decode the ith component into a clean (unescaped) value list.
Sourcepub fn decode_bytes_at(&self, i: usize) -> Cow<'_, [u8]>
pub fn decode_bytes_at(&self, i: usize) -> Cow<'_, [u8]>
The ith component’s first value as raw unescaped bytes, not
transcoded, for a value carrying a foreign charset.
Sourcepub fn decode_scalar_at(&self, i: usize) -> Cow<'_, str>
pub fn decode_scalar_at(&self, i: usize) -> Cow<'_, str>
Decode the ith component’s first value (empty when there is none).
Sourcepub fn decode_joined_at(&self, i: usize) -> Cow<'_, str>
pub fn decode_joined_at(&self, i: usize) -> Cow<'_, str>
Decode the ith component as a single value, keeping its ,-separated
pieces joined. For values like URIs whose comma is a literal part of the
value, not a list separator (so they must not be truncated).
Trait Implementations§
Source§impl<'a> Clone for IcalValueNode<'a>
impl<'a> Clone for IcalValueNode<'a>
Source§fn clone(&self) -> IcalValueNode<'a>
fn clone(&self) -> IcalValueNode<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more