pub struct Phrase { /* private fields */ }
Expand description
A phrase that is made up of an adverb, adjective, noun.
When parsed from a slice it will lookup the sha parts in the dictionary. It knows how to properly format itself if a different case is selected.
Implementations§
Source§impl Phrase
impl Phrase
Sourcepub fn with_case(self, f: Case) -> Self
pub fn with_case(self, f: Case) -> Self
Consumes the current phrase and returns a new one with a different case.
§Example
use std::str::FromStr;
use git_release_name::{Phrase, Case};
let phrase = "1234".parse::<Phrase>().unwrap().with_case(Case::Upper);
assert_eq!(phrase.case(), Case::Upper);
Sourcepub fn adjective(&self) -> &str
pub fn adjective(&self) -> &str
The adjective component of this phrase
§Example
use std::str::FromStr;
use git_release_name::Phrase;
let phrase: Phrase = "1234".parse().unwrap();
assert_eq!(phrase.adjective(), "courant");
Sourcepub fn adverb(&self) -> &str
pub fn adverb(&self) -> &str
The adverb component of this phrase
§Example
use std::str::FromStr;
use git_release_name::Phrase;
let phrase: Phrase = "1234".parse().unwrap();
assert_eq!(phrase.adverb(), "ambitiously");
Trait Implementations§
impl Eq for Phrase
impl StructuralPartialEq for Phrase
Auto Trait Implementations§
impl Freeze for Phrase
impl RefUnwindSafe for Phrase
impl Send for Phrase
impl Sync for Phrase
impl Unpin for Phrase
impl UnwindSafe for Phrase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more