pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
Sourcepub fn init(username: &str, password: &str) -> Self
pub fn init(username: &str, password: &str) -> Self
Initialization of the client
Initialized client will be stored for future requests
Sourcepub fn get(&self, path: &str) -> Result<Response, Error>
pub fn get(&self, path: &str) -> Result<Response, Error>
Get a file from Webdav server
Use absolute path to the webdav server file location
Sourcepub fn put<B: Into<Body>>(&self, body: B, path: &str) -> Result<Response, Error>
pub fn put<B: Into<Body>>(&self, body: B, path: &str) -> Result<Response, Error>
Upload a file/zip on Webdav server
It can be any type of file as long as it is transformed to a vector of bytes (Vec
Use absolute path to the webdav server folder location
Sourcepub fn delete(&self, path: &str) -> Result<Response, Error>
pub fn delete(&self, path: &str) -> Result<Response, Error>
Deletes the collection, file, folder or zip archive at the given path on Webdav server
Use absolute path to the webdav server file location
Sourcepub fn unzip(&self, path: &str) -> Result<Response, Error>
pub fn unzip(&self, path: &str) -> Result<Response, Error>
Unzips the .zip archieve on Webdav server
Use absolute path to the webdav server file location
Sourcepub fn mkcol(&self, path: &str) -> Result<Response, Error>
pub fn mkcol(&self, path: &str) -> Result<Response, Error>
Creates a directory on Webdav server
Use absolute path to the webdav server file location
Sourcepub fn mv(&self, from: &str, to: &str) -> Result<Response, Error>
pub fn mv(&self, from: &str, to: &str) -> Result<Response, Error>
Rename or move a collection, file, folder on Webdav server
If the file location changes it will move the file, if only the file name changes it will rename it.
Use absolute path to the webdav server file location
Sourcepub fn list(&self, path: &str, depth: &str) -> Result<Response, Error>
pub fn list(&self, path: &str, depth: &str) -> Result<Response, Error>
List files and folders at the given path on Webdav server
Depth of “0” applies only to the resource, “1” to the resource and it’s children, “infinity” to the resource and all it’s children recursively The result will contain an xml list with the remote folder contents.
Use absolute path to the webdav server folder location