Struct icalendar::Property

source ·
pub struct Property { /* private fields */ }
Expand description

key-value pairs inside of Components

Implementations§

source§

impl Property

source

pub fn new(key: impl Into<String>, val: impl Into<String>) -> Self

Guess what this does :D

source

pub fn new_pre_alloc(key: String, val: String) -> Self

👎Deprecated

if you already have Strings I’ll gladly take

source

pub fn key(&self) -> &str

Returns a reference to the key field.

source

pub fn value(&self) -> &str

Returns a reference to the value field.

source

pub fn params(&self) -> &HashMap<String, Parameter>

Returns a reference to the parameters.

source

pub fn from_array<P: Into<Property>, const N: usize>( array: [P; N], ) -> Vec<Property>

Produces a Vec of Property from an array of other types.

source

pub fn value_type(&self) -> Option<ValueType>

Returns the VALUE parameter, if any is specified.

source

pub fn get_value_as<F, T>(&self, converter: F) -> Option<T>
where F: Fn(&str) -> Option<T>,

Returns the value as a certain type

source

pub fn get_param_as<F, T>(&self, key: &str, converter: F) -> Option<T>
where F: Fn(&str) -> Option<T>,

Returns the value of a parameter as a certain type

source

pub fn append_parameter<I: Into<Parameter>>( &mut self, into_parameter: I, ) -> &mut Self

Appends a new parameter.

source

pub fn add_parameter(&mut self, key: &str, val: &str) -> &mut Self

Creates and appends a parameter.

source

pub fn done(&mut self) -> Self

End of Builder Pattern.

Trait Implementations§

source§

impl Clone for Property

source§

fn clone(&self) -> Property

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Property

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<(&str, &str)> for Property

source§

fn from((key, val): (&str, &str)) -> Self

Converts to this type from the input type.
source§

impl From<Class> for Property

source§

fn from(val: Class) -> Self

Converts to this type from the input type.
source§

impl From<EventStatus> for Property

source§

fn from(val: EventStatus) -> Self

Converts to this type from the input type.
source§

impl From<Property<'_>> for Property

source§

fn from(parsed: Property<'_>) -> Self

Converts to this type from the input type.
source§

impl From<TimeDelta> for Property

source§

fn from(duration: Duration) -> Self

Converts to this type from the input type.
source§

impl From<TodoStatus> for Property

source§

fn from(val: TodoStatus) -> Self

Converts to this type from the input type.
source§

impl From<Trigger> for Property

source§

fn from(trigger: Trigger) -> Self

Converts to this type from the input type.
source§

impl FromStr for Property

§

type Err = String

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl PartialEq for Property

source§

fn eq(&self, other: &Property) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<&Property> for Trigger

§

type Error = ()

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

fn try_from(prop: &Property) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryInto<String> for Property

§

type Error = Error

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

fn try_into(self) -> Result<String, Self::Error>

Performs the conversion.
source§

impl Eq for Property

source§

impl StructuralPartialEq for Property

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.