[−][src]Struct verba::noun::indeclinable::Indeclinable
Methods
impl Indeclinable
[src]
pub fn new(
declension: String,
gender: Gender
) -> Result<Indeclinable, IndeclinableError>
[src]
declension: String,
gender: Gender
) -> Result<Indeclinable, IndeclinableError>
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]
fn gender(&self) -> Gender
[src]
fn stem(&self) -> Option<&str>
[src]
fn group(&self) -> Option<Group>
[src]
fn decline(&self, _number: Number, _case: Case) -> Option<Vec<String>>
[src]
impl Clone for Indeclinable
[src]
fn clone(&self) -> 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
impl Sync for Indeclinable
impl Unpin for Indeclinable
impl Send for Indeclinable
impl UnwindSafe for Indeclinable
impl RefUnwindSafe for Indeclinable
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,