[][src]Enum url_path::UrlPath

pub enum UrlPath {
    Path {
        parent: Option<String>,
        last: Option<String>,
        is_absolute: bool,
    },
    External(String),
}

Variants

Path

Fields of Path

parent: Option<String>last: Option<String>

the last element of the url when split with /

is_absolute: bool
External(String)

Methods

impl UrlPath[src]

pub fn new(path: &str) -> Self[src]

pub fn is_absolute(&self) -> bool[src]

pub fn is_external(&self) -> bool[src]

pub fn last(&self) -> Option<String>[src]

pub fn parent(&self) -> Option<String>[src]

pub fn extension(&self) -> Option<String>[src]

return the extension (ie: html, md, txt ) of the path if there is

pub fn is_extension(&self, ext: &str) -> bool[src]

returns true if the extension of this path matched the argument extension ext

pub fn normalize(&self) -> String[src]

return the constructed file

Auto Trait Implementations

impl RefUnwindSafe for UrlPath

impl Send for UrlPath

impl Sync for UrlPath

impl Unpin for UrlPath

impl UnwindSafe for UrlPath

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.