Enum git_checks::FileName [−][src]
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]
impl FileNamepub fn new<P>(path: P) -> Self where
P: AsRef<str>, [src]
pub fn new<P>(path: P) -> Self where
P: AsRef<str>, Parse a path from Git.
Panics
Panics if non-ASCII paths are not formatted according to Git's ls-files formatting using
core.quotePath=true.
pub fn as_str(&self) -> &str[src]
pub fn as_str(&self) -> &strThe file name as a str.
pub fn as_path(&self) -> &Path[src]
pub fn as_path(&self) -> &PathThe file name as a Path.
pub fn as_bytes(&self) -> &[u8][src]
pub fn as_bytes(&self) -> &[u8]The raw bytes of the file name.
Trait Implementations
impl Debug for FileName[src]
impl Debug for FileNamefn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Clone for FileName[src]
impl Clone for FileNamefn clone(&self) -> FileName[src]
fn clone(&self) -> FileNameReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Eq for FileName[src]
impl Eq for FileNameimpl Display for FileName[src]
impl Display for FileNamefn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl PartialEq for FileName[src]
impl PartialEq for FileNamefn eq(&self, rhs: &Self) -> bool[src]
fn eq(&self, rhs: &Self) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl AsRef<str> for FileName[src]
impl AsRef<str> for FileNameimpl AsRef<[u8]> for FileName[src]
impl AsRef<[u8]> for FileNameimpl AsRef<OsStr> for FileName[src]
impl AsRef<OsStr> for FileNameimpl AsRef<Path> for FileName[src]
impl AsRef<Path> for FileName