[][src]Struct webdav_handler::webpath::WebPath

pub struct WebPath { /* fields omitted */ }

Path information relative to a prefix.

Methods

impl WebPath[src]

pub fn from_str(src: &str, prefix: &str) -> Result<WebPath, ParseError>[src]

from URL encoded strings: path and prefix.

pub fn from_uri(uri: &Uri, prefix: &str) -> Result<Self, ParseError>[src]

from request.uri

pub fn from_url(url: &Url, prefix: &str) -> Result<Self, ParseError>[src]

from url::Url and (not-url-encoded) prefix string.

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

as URL encoded string, with prefix.

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

as utf8 string, with prefix. uses String::from_utf8_lossy.

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

as raw bytes, not encoded, no prefix.

pub fn as_pathbuf(&self) -> PathBuf[src]

as OS specific Path. never ends in "/".

pub fn as_pathbuf_with_prefix<P: AsRef<Path>>(&self, path: P) -> PathBuf[src]

prefix the WebPath with a Path and return a PathBuf

pub fn as_rel_pathbuf(&self) -> PathBuf[src]

as OS specific Path, relative (remove first slash)

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

is this a collection i.e. does the original URL path end in "/".

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

return the URL prefix.

pub fn add_slash(&mut self)[src]

add a slash to the end of the path (if not already present).

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

The filename is the last segment of the path. Can be empty.

pub fn num_segments(&self) -> usize[src]

Count the number of segments the path has. "/" has 0.

pub fn push_segment(&mut self, b: &[u8])[src]

Add a segment to the end of the path.

Trait Implementations

impl PartialEq<WebPath> for WebPath[src]

Comparision ignores any trailing slash, so /foo == /foo/

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl Clone for WebPath[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for WebPath[src]

impl Display for WebPath[src]

Auto Trait Implementations

impl Send for WebPath

impl Sync for WebPath

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From<T> for 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.

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self