Struct TagSection

Source
pub struct TagSection { /* private fields */ }
Expand description

A section in a TagFile. A TagFile is made up of double-newline (\n\n) separated paragraphs, each of which make up one of these sections.

Implementations§

Source§

impl TagSection

Source

pub fn new(section: &str) -> Result<Self, ParserError>

Create a new TagSection instance.

§Returns
  • A Result: The Ok variant if there was no issue parsing the section, and the Err variant if there was.
Source

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

Get the underlying HashMap used in the generated TagSection.

Source

pub fn get(&self, key: &str) -> Option<&String>

Get the value of the specified key.

Source

pub fn get_default<'a, 'b: 'a>(&'a self, key: &str, default: &'b str) -> &str

Get the value of the specified key,

Returns specified default on failure.

Trait Implementations§

Source§

impl Debug for TagSection

Source§

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

Formats the value using the given formatter. Read more

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> 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 = 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>,

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.