Skip to main content

WebdavRequest

Struct WebdavRequest 

Source
pub struct WebdavRequest { /* private fields */ }
Expand description

Fluent builder for a WebDAV HTTP request.

Implementations§

Source§

impl WebdavRequest

Source

pub fn new( base_url: &Url, auth: &WebdavAuth, user_agent: &str, method: &str, path: &str, ) -> Self

Builds a request targeting path (relative to base_url) with the given HTTP method. Sets Host from base_url and the optional Authorization header from auth. user_agent is emitted as the User-Agent header.

Source

pub fn get( base_url: &Url, auth: &WebdavAuth, user_agent: &str, path: &str, ) -> Self

Builds a GET request.

Source

pub fn delete( base_url: &Url, auth: &WebdavAuth, user_agent: &str, path: &str, ) -> Self

Builds a DELETE request.

Source

pub fn put( base_url: &Url, auth: &WebdavAuth, user_agent: &str, path: &str, ) -> Self

Builds a PUT request.

Source

pub fn options( base_url: &Url, auth: &WebdavAuth, user_agent: &str, path: &str, ) -> Self

Builds an OPTIONS request.

Source

pub fn mkcol( base_url: &Url, auth: &WebdavAuth, user_agent: &str, path: &str, ) -> Self

Builds a MKCOL request (RFC 4918 §9.3).

Source

pub fn propfind( base_url: &Url, auth: &WebdavAuth, user_agent: &str, path: &str, ) -> Self

Builds a PROPFIND request (RFC 4918 §9.1).

Source

pub fn proppatch( base_url: &Url, auth: &WebdavAuth, user_agent: &str, path: &str, ) -> Self

Builds a PROPPATCH request (RFC 4918 §9.2).

Source

pub fn report( base_url: &Url, auth: &WebdavAuth, user_agent: &str, path: &str, ) -> Self

Builds a REPORT request (RFC 3253 §3.6).

Source

pub fn copy( base_url: &Url, auth: &WebdavAuth, user_agent: &str, path: &str, ) -> Self

Builds a COPY request (RFC 4918 §9.8).

Source

pub fn move( base_url: &Url, auth: &WebdavAuth, user_agent: &str, path: &str, ) -> Self

Builds a MOVE request (RFC 4918 §9.9).

Source

pub fn depth(self, depth: u8) -> Self

Sets the Depth header (RFC 4918 §10.2).

Source

pub fn destination(self, destination: &str) -> Self

Sets the Destination header (RFC 4918 §10.3).

Source

pub fn overwrite(self, overwrite: bool) -> Self

Sets the Overwrite header (RFC 4918 §10.6) to T or F.

Source

pub fn if_match(self, etag: &str) -> Self

Sets the If-Match header (RFC 9110 §13.1.1) to the given ETag.

Source

pub fn if_none_match(self, etag: &str) -> Self

Sets the If-None-Match header (RFC 9110 §13.1.2) to the given ETag.

Source

pub fn content_type(self, value: &str) -> Self

Sets the Content-Type header.

Source

pub fn content_type_xml(self) -> Self

Shortcut for content_type("text/xml; charset=utf-8").

Source

pub fn content_type_ical(self) -> Self

Shortcut for content_type("text/calendar; charset=utf-8").

Source

pub fn content_type_vcard(self) -> Self

Shortcut for content_type("text/vcard; charset=utf-8").

Source

pub fn body(self, body: Vec<u8>) -> HttpRequest

Finalizes the request with the given body and returns the underlying HttpRequest ready for crate::rfc4918::send.

Trace-logs the body: WebDAV request bodies are always UTF-8 text (XML, iCalendar or vCard), so io-webdav can safely render them, whereas io-http (which cannot know the content type) does not.

Trait Implementations§

Source§

impl Clone for WebdavRequest

Source§

fn clone(&self) -> WebdavRequest

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WebdavRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.