Struct plugx_config::entity::ConfigurationEntity
source · 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 ConfigurationParser::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 ConfigurationParser>]
) -> Option<String>
pub fn guess_format( &self, parser_list: &[Box<dyn ConfigurationParser>] ) -> 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 ConfigurationParser>] ) -> Result<Input, ConfigurationParserError>
pub fn parse_contents_mut( &mut self, parser_list: &[Box<dyn ConfigurationParser>] ) -> Result<&mut Input, ConfigurationParserError>
Trait Implementations§
source§impl Clone for ConfigurationEntity
impl Clone for ConfigurationEntity
source§fn clone(&self) -> ConfigurationEntity
fn clone(&self) -> ConfigurationEntity
Returns a copy 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
source§fn eq(&self, other: &ConfigurationEntity) -> bool
fn eq(&self, other: &ConfigurationEntity) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl StructuralPartialEq for ConfigurationEntity
Auto Trait Implementations§
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