[][src]Struct verba::noun::indeclinable::Indeclinable

pub struct Indeclinable { /* fields omitted */ }

Methods

impl Indeclinable[src]

pub fn new(
    declension: String,
    gender: Gender
) -> Result<Indeclinable, IndeclinableError>
[src]

This function is used to create indeclinable Latin nouns.

Certain Latin nouns cannot be declined. These nouns, not surprisingly, are referred to as indeclinable nouns. When [decline] is called on a noun created with this function, it will always return the singular nominative form.

Example

use verba::noun::{Noun};
 
use verba::noun as N;
 
let nom = "nīl".to_string();
 
let noun = N::Indeclinable::new(nom, N::Gender::Neuter).unwrap();
 
assert_eq!(noun.decline(N::Number::Singular, N::Case::Nominative), Some(vec!["nīl".to_string()]));
assert_eq!(noun.decline(N::Number::Singular, N::Case::Genitive), Some(vec!["nīl".to_string()]));
assert_eq!(noun.decline(N::Number::Singular, N::Case::Dative), Some(vec!["nīl".to_string()]));
assert_eq!(noun.decline(N::Number::Singular, N::Case::Accusative), Some(vec!["nīl".to_string()]));
assert_eq!(noun.decline(N::Number::Singular, N::Case::Ablative), Some(vec!["nīl".to_string()]));
assert_eq!(noun.decline(N::Number::Singular, N::Case::Vocative), Some(vec!["nīl".to_string()]));
assert_eq!(noun.decline(N::Number::Plural, N::Case::Nominative), Some(vec!["nīl".to_string()]));
assert_eq!(noun.decline(N::Number::Plural, N::Case::Genitive), Some(vec!["nīl".to_string()]));
assert_eq!(noun.decline(N::Number::Plural, N::Case::Dative), Some(vec!["nīl".to_string()]));
assert_eq!(noun.decline(N::Number::Plural, N::Case::Accusative), Some(vec!["nīl".to_string()]));
assert_eq!(noun.decline(N::Number::Plural, N::Case::Ablative), Some(vec!["nīl".to_string()]));
assert_eq!(noun.decline(N::Number::Plural, N::Case::Vocative), Some(vec!["nīl".to_string()]));

Trait Implementations

impl Noun for Indeclinable[src]

impl Clone for Indeclinable[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Indeclinable[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]