pub struct ConfigurationEntity { /* private fields */ }Expand description
A configuration entity for each plugin.
Implementations§
Source§impl ConfigurationEntity
impl ConfigurationEntity
Sourcepub fn new<I, P, L>(item: I, url: Url, plugin_name: P, loader_name: L) -> Self
pub fn new<I, P, L>(item: I, url: Url, plugin_name: P, loader_name: L) -> Self
Constructs a new ConfigurationEntity.
It’s better to set the format (via Self::set_format or Self::with_format) and if we don’t and try to parse its contents, All parsers that support Parser::is_format_supported method try to validate the contents to pick it up for future parsing!
pub fn set_format<F: AsRef<str>>(&mut self, format: F)
pub fn with_format<F: AsRef<str>>(self, format: F) -> Self
pub fn set_contents<C: AsRef<str>>(&mut self, contents: C)
pub fn with_contents<C: AsRef<str>>(self, contents: C) -> Self
pub fn set_parsed_contents<I: Into<Input>>(&mut self, contents: I)
pub fn with_parsed_contents<I: Into<Input>>(self, contents: I) -> Self
pub fn item(&self) -> &String
pub fn item_mut(&mut self) -> &mut String
pub fn url(&self) -> &Url
pub fn url_mut(&mut self) -> &mut Url
pub fn plugin_name(&self) -> &String
pub fn plugin_name_mut(&mut self) -> &mut String
pub fn maybe_format(&self) -> Option<&String>
pub fn maybe_format_mut(&mut self) -> &mut Option<String>
pub fn maybe_contents(&self) -> Option<&String>
pub fn maybe_contents_mut(&mut self) -> &mut Option<String>
pub fn maybe_parsed_contents(&self) -> Option<&Input>
pub fn maybe_parsed_contents_mut(&mut self) -> &mut Option<Input>
Sourcepub fn guess_format(&self, parser_list: &[Box<dyn Parser>]) -> Option<String>
pub fn guess_format(&self, parser_list: &[Box<dyn Parser>]) -> Option<String>
We have to call it after calling Self::set_contents or Self::with_contents and If no contents is set, It yields None too.
pub fn parse_contents( &self, parser_list: &[Box<dyn Parser>], ) -> Result<Input, Error>
pub fn parse_contents_mut( &mut self, parser_list: &[Box<dyn Parser>], ) -> Result<&mut Input, Error>
Trait Implementations§
Source§impl Clone for ConfigurationEntity
impl Clone for ConfigurationEntity
Source§fn clone(&self) -> ConfigurationEntity
fn clone(&self) -> ConfigurationEntity
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConfigurationEntity
impl Debug for ConfigurationEntity
Source§impl Display for ConfigurationEntity
impl Display for ConfigurationEntity
Source§impl PartialEq for ConfigurationEntity
impl PartialEq for ConfigurationEntity
impl StructuralPartialEq for ConfigurationEntity
Auto Trait Implementations§
impl Freeze for ConfigurationEntity
impl RefUnwindSafe for ConfigurationEntity
impl Send for ConfigurationEntity
impl Sync for ConfigurationEntity
impl Unpin for ConfigurationEntity
impl UnwindSafe for ConfigurationEntity
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more