Skip to main content

IcalPropBuilder

Struct IcalPropBuilder 

Source
pub struct IcalPropBuilder<'a, L: IcalPropSpec> {
    pub version: IcalVersion,
    pub params: Vec<IcalParam<'a>>,
    /* private fields */
}
Expand description

A version-aware builder for one property, keyed by its property marker.

Fields§

§version: IcalVersion

The calendar version the property is built for.

§params: Vec<IcalParam<'a>>

The parameters accumulated so far.

Implementations§

Source§

impl<'a, L: IcalPropSpec> IcalPropBuilder<'a, L>

Source

pub fn new(version: IcalVersion) -> Self

Start a builder for the given calendar version.

Source

pub fn param(self, param: IcalParam<'a>) -> Self

Add a parameter (validated against the spec on build).

Source

pub fn build( self, value: IcalValue<'a>, ) -> Result<IcalProp<'a>, Vec<IcalValidateError>>

Finish with a value, emitting the property named by the spec.

Runs the same per-property check as Ical::validate: the value kind must be allowed and every known parameter must be allowed for the version (unknown, i.e. extension, parameters pass).

Auto Trait Implementations§

§

impl<'a, L> Freeze for IcalPropBuilder<'a, L>
where PhantomData<L>: Freeze,

§

impl<'a, L> RefUnwindSafe for IcalPropBuilder<'a, L>

§

impl<'a, L> Send for IcalPropBuilder<'a, L>
where PhantomData<L>: Send,

§

impl<'a, L> Sync for IcalPropBuilder<'a, L>
where PhantomData<L>: Sync,

§

impl<'a, L> Unpin for IcalPropBuilder<'a, L>
where PhantomData<L>: Unpin,

§

impl<'a, L> UnsafeUnpin for IcalPropBuilder<'a, L>

§

impl<'a, L> UnwindSafe for IcalPropBuilder<'a, L>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.