[][src]Struct gitar::Luthier

pub struct Luthier { /* fields omitted */ }

A Guitar builder.

Implementations

impl Luthier[src]

pub fn new(num_frets: usize) -> Self[src]

Creates a new Luthier to build a Guitar with the given number of frets.

Examples

let luthier = gitar::Luthier::new(21);

pub fn string(self, tuning: Vec<Note>) -> Self[src]

Strings the luthier's Guitar with the given tuning (a vector of open string note values).

Examples

use minstrel::Note;
use std::str::FromStr;

// Standard tuning for a bass guitar
let tuning = vec![
    Note::from_str("E1").unwrap(),
    Note::from_str("A1").unwrap(),
    Note::from_str("D2").unwrap(),
    Note::from_str("G2").unwrap(),
];

let luthier = gitar::Luthier::new(24).string(tuning);

pub fn add_capo(self, fret_number: usize) -> Self[src]

Puts a 'capo' on the luthier's Guitar. This essentially shifts the fret values of each string up by fret_number of semitones. It also reduces the number of frets on the guitar by the same amount.

Examples

// Because of the capo, the resulting guitar will only have 18 functional
// frets, even though it was initialised with 22
let luthier = gitar::Luthier::new(22)
    .string(gitar::standard_tuning())
    .add_capo(4);

Panics

This method panics if the given fret_number is greater than the number of frets on the luthier's Guitar, or if that Guitar has not been strung.

pub fn build(self) -> Guitar[src]

Returns the constructed Guitar, consuming the Luthier.

Trait Implementations

impl Debug for Luthier[src]

Auto Trait Implementations

impl RefUnwindSafe for Luthier

impl Send for Luthier

impl Sync for Luthier

impl Unpin for Luthier

impl UnwindSafe for Luthier

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.