Struct git_release_name::Phrase
[−]
[src]
pub struct Phrase { /* fields omitted */ }
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.
Methods
impl Phrase
[src]
pub fn with_case(self, f: Case) -> Self
[src]
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);
pub fn adjective(&self) -> &str
[src]
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");
pub fn adverb(&self) -> &str
[src]
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");
pub fn noun(&self) -> &str
[src]
The noun component of this phrase
Example
use std::str::FromStr; use git_release_name::Phrase; let phrase: Phrase = "1234".parse().unwrap(); assert_eq!(phrase.noun(), "gantlines");
pub fn case(&self) -> Case
[src]
The case the phrase will be formated with
Example
use std::str::FromStr; use git_release_name::{Phrase, Case}; let phrase: Phrase = "1234".parse().unwrap(); assert_eq!(phrase.case(), Case::Lower);
Trait Implementations
impl Debug for Phrase
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Eq for Phrase
[src]
impl PartialEq for Phrase
[src]
fn eq(&self, __arg_0: &Phrase) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Phrase) -> bool
[src]
This method tests for !=
.
impl Clone for Phrase
[src]
fn clone(&self) -> Phrase
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl FromStr for Phrase
[src]
type Err = ParsePhraseError
The associated error which can be returned from parsing.
fn from_str(sha: &str) -> Result<Phrase, Self::Err>
[src]
Parses a string s
to return a value of this type. Read more