[][src]Enum git_checks_core::FileName

pub enum FileName {
    // some variants omitted
}

A representation of filenames as given by Git.

Git supports filenames with control characters and other non-Unicode byte sequence which are quoted when listed in certain Git command outputs. This enumeration smooths over these differences and offers accessors to the file name in different representations.

Generally, the as_ methods should be preferred to pattern matching on this enumeration.

Methods

impl FileName[src]

pub fn new<P>(path: P) -> Result<Self, FileNameError> where
    P: AsRef<str>, 
[src]

Parse a path from Git.

pub fn as_str(&self) -> &str[src]

The file name as a str.

pub fn as_path(&self) -> &Path[src]

The file name as a Path.

pub fn as_bytes(&self) -> &[u8][src]

The raw bytes of the file name.

Trait Implementations

impl AsRef<str> for FileName[src]

impl AsRef<[u8]> for FileName[src]

impl AsRef<OsStr> for FileName[src]

impl AsRef<Path> for FileName[src]

impl Clone for FileName[src]

impl Eq for FileName[src]

impl PartialEq<FileName> for FileName[src]

impl Display for FileName[src]

impl Debug for FileName[src]

impl StructuralEq for FileName[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.

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

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

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