reagent

Struct Reagent

Source
pub struct Reagent {
    pub package: Option<String>,
    pub description: Option<String>,
    pub url: Option<String>,
    pub version: Option<String>,
    pub license: Option<String>,
    pub name: Option<String>,
    pub email: Option<String>,
    pub debian: bool,
    pub redox: bool,
}
Expand description

Configuration for reagent, stored in reagent.toml

Fields§

§package: Option<String>

The name of the package: "reagent"

§description: Option<String>

The description of the package: "Redox OS Standard Tests"

§url: Option<String>

The repository or homepage of the package: "https://gitlab.redox-os.org/redox-os/reagent"

§version: Option<String>

The current version of the package: "0.1.0"

§license: Option<String>

The license used by the package: "MIT"

§name: Option<String>

The name of the package maintainer: "Jeremy Soller"

§email: Option<String>

The email of the package maintainer: "jackpot51@gmail.com"

§debian: bool

Debian packaging

§redox: bool

CI for Redox OS

Implementations§

Source§

impl Reagent

Source

pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self>

Create a reagent instance from a toml file

Source

pub fn split(string: &str) -> (&str, &str, &str)

Split a string based on reagent tags, returning the following:

  • Lines up to the tag
  • Lines in between and including the tags
  • Lines after the tag If there are no reagent tags, the entire file is assumed to be in between tags
Source

pub fn generate( &self, input: &str, original_opt: Option<&str>, ) -> Result<String, Error>

Generate updated file based on input template If the file is empty, use the entire input file to generate it If the file is not empty, only generate the sections inside of reagent tags This starts from the line after a tag, and ends on the line before a tag

Trait Implementations§

Source§

impl Content for Reagent

Source§

fn capacity_hint(&self, tpl: &Template<'_>) -> usize

How much capacity is likely required for all the data in this Content for a given Template.
Source§

fn render_field_escaped<E>( &self, hash: u64, _: &str, encoder: &mut E, ) -> Result<(), E::Error>
where E: Encoder,

Render a field by the hash or string of its name. Read more
Source§

fn render_field_unescaped<E>( &self, hash: u64, _: &str, encoder: &mut E, ) -> Result<(), E::Error>
where E: Encoder,

Render a field by the hash or string of its name. Read more
Source§

fn render_field_section<'section, E>( &self, hash: u64, _: &str, section: Section<'section>, encoder: &mut E, ) -> Result<(), E::Error>
where E: Encoder,

Render a field by the hash or string of its name, as a section.
Source§

fn render_field_inverse<'section, E>( &self, hash: u64, _: &str, section: Section<'section>, encoder: &mut E, ) -> Result<(), E::Error>
where E: Encoder,

Render a field, by the hash of or string its name, as an inverse section.
Source§

fn is_truthy(&self) -> bool

Marks whether this content is truthy. Used when attempting to render a section.
Source§

fn render_escaped<'section, E>( &self, _encoder: &mut E, ) -> Result<(), <E as Encoder>::Error>
where E: Encoder,

Renders self as a variable to the encoder. Read more
Source§

fn render_unescaped<'section, E>( &self, encoder: &mut E, ) -> Result<(), <E as Encoder>::Error>
where E: Encoder,

Renders self as a variable to the encoder. Read more
Source§

fn render_cmark<'section, E>( &self, encoder: &mut E, ) -> Result<(), <E as Encoder>::Error>
where E: Encoder,

Renders self as a variable to the encoder with CommonMark processing. Read more
Source§

fn render_section<'section, E>( &self, section: Section<'section>, encoder: &mut E, ) -> Result<(), <E as Encoder>::Error>
where E: Encoder,

Render a section with self.
Source§

fn render_inverse<'section, E>( &self, section: Section<'section>, encoder: &mut E, ) -> Result<(), <E as Encoder>::Error>
where E: Encoder,

Render a section with self.
Source§

impl Debug for Reagent

Source§

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

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

impl<'de> Deserialize<'de> for Reagent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Reagent

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,