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]

[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);

[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");

[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");

[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");

[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]

[src]

Formats the value using the given formatter. Read more

impl Eq for Phrase
[src]

impl PartialEq for Phrase
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Clone for Phrase
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl FromStr for Phrase
[src]

The associated error which can be returned from parsing.

[src]

Parses a string s to return a value of this type. Read more

impl Display for Phrase
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Phrase

impl Sync for Phrase