Noun

Struct Noun 

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

Has the Ranting trait. Often you may want to #[derive(Ranting)] and sometimes override some of the trait functions.

Implementations§

Source§

impl Noun

Source

pub fn new(name: &str, subject: &str) -> Self

Trait Implementations§

Source§

impl Display for Noun

Source§

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

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

impl Ranting for &Noun

Source§

fn name(&self, uc: bool) -> String

return the name, which is struct name or the #{ranting(name = "..")] value, or self.name if the name attribute was set to “$”
Source§

fn subjective(&self) -> &str

return the subject: “it” or the #{ranting(subject = "..")] value; self.subject if “$”.
Source§

fn is_plural(&self) -> bool

return if plural (the subject, or if you, the #{ranting(plural_you = "true/false")] value, default false
Source§

fn inflect(&self, as_plural: bool, uc: bool) -> String

return the singular or plural form as configured, starting with capital if uc is set. use #{ranting(singular_end = "..", plural_end = "..")] if not plural = singular + “s”
Source§

fn skip_article(&self) -> bool

If an article is only required when emphasizing, set #{ranting(no_article = "true")], and this function will return accordingly (used by placeholders).
Source§

impl Ranting for &mut Noun

Source§

fn name(&self, uc: bool) -> String

return the name, which is struct name or the #{ranting(name = "..")] value, or self.name if the name attribute was set to “$”
Source§

fn subjective(&self) -> &str

return the subject: “it” or the #{ranting(subject = "..")] value; self.subject if “$”.
Source§

fn is_plural(&self) -> bool

return if plural (the subject, or if you, the #{ranting(plural_you = "true/false")] value, default false
Source§

fn inflect(&self, as_plural: bool, uc: bool) -> String

return the singular or plural form as configured, starting with capital if uc is set. use #{ranting(singular_end = "..", plural_end = "..")] if not plural = singular + “s”
Source§

fn skip_article(&self) -> bool

If an article is only required when emphasizing, set #{ranting(no_article = "true")], and this function will return accordingly (used by placeholders).
Source§

impl Ranting for Noun

Source§

fn name(&self, uc: bool) -> String

return the name, which is struct name or the #{ranting(name = "..")] value, or self.name if the name attribute was set to “$”
Source§

fn subjective(&self) -> &str

return the subject: “it” or the #{ranting(subject = "..")] value; self.subject if “$”.
Source§

fn is_plural(&self) -> bool

return if plural (the subject, or if you, the #{ranting(plural_you = "true/false")] value, default false
Source§

fn inflect(&self, as_plural: bool, uc: bool) -> String

return the singular or plural form as configured, starting with capital if uc is set. use #{ranting(singular_end = "..", plural_end = "..")] if not plural = singular + “s”
Source§

fn skip_article(&self) -> bool

If an article is only required when emphasizing, set #{ranting(no_article = "true")], and this function will return accordingly (used by placeholders).

Auto Trait Implementations§

§

impl Freeze for Noun

§

impl RefUnwindSafe for Noun

§

impl Send for Noun

§

impl Sync for Noun

§

impl Unpin for Noun

§

impl UnwindSafe for Noun

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.