Trait Component

Source
pub trait Component {
    // Required methods
    fn add_sub_component<B: BufRead>(
        &mut self,
        value: &str,
        line_parser: &RefCell<PropertyParser<B>>,
    ) -> Result<(), ParserError>;
    fn add_property(&mut self, property: Property);
    fn get_property<'c>(&'c self, name: &str) -> Option<&'c Property>;
    fn get_property_mut<'c>(
        &'c mut self,
        name: &str,
    ) -> Option<&'c mut Property>;

    // Provided method
    fn parse<B: BufRead>(
        &mut self,
        line_parser: &RefCell<PropertyParser<B>>,
    ) -> Result<(), ParserError> { ... }
}
Expand description

An interface for an Ical/Vcard component.

It take a PropertyParser and fill the component with. It’s also able to create sub-component used by event and alarms.

Required Methods§

Source

fn add_sub_component<B: BufRead>( &mut self, value: &str, line_parser: &RefCell<PropertyParser<B>>, ) -> Result<(), ParserError>

Add the givent sub component.

Source

fn add_property(&mut self, property: Property)

Add the givent property.

Source

fn get_property<'c>(&'c self, name: &str) -> Option<&'c Property>

Find a given property.

Source

fn get_property_mut<'c>(&'c mut self, name: &str) -> Option<&'c mut Property>

Provided Methods§

Source

fn parse<B: BufRead>( &mut self, line_parser: &RefCell<PropertyParser<B>>, ) -> Result<(), ParserError>

Parse the content from line_parser and fill the component with.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§