[−][src]Struct tus_client::Client
Used to interact with a tus endpoint.
Methods
impl<'a> Client<'a>
[src]
pub fn new(http_handler: impl HttpHandler + 'a) -> Self
[src]
Instantiates a new instance of Client
. http_handler
needs to implement the HttpHandler
trait.
A default implementation of this trait for the reqwest
library is available by enabling the reqwest
feature.
pub fn with_method_override(http_handler: impl HttpHandler + 'a) -> Self
[src]
Some environments might not support using the HTTP methods PATCH
and DELETE
. Use this method to create a Client
which uses the X-HTTP-METHOD-OVERRIDE
header to specify these methods instead.
pub fn get_info(&self, url: &str) -> Result<UploadInfo, Error>
[src]
Get info about a file on the server.
pub fn upload(&self, url: &str, path: &Path) -> Result<(), Error>
[src]
Upload a file to the specified upload URL.
pub fn upload_with_chunk_size(
&self,
url: &str,
path: &Path,
chunk_size: usize
) -> Result<(), Error>
[src]
&self,
url: &str,
path: &Path,
chunk_size: usize
) -> Result<(), Error>
Upload a file to the specified upload URL with the given chunk size.
pub fn get_server_info(&self, url: &str) -> Result<ServerInfo, Error>
[src]
Get information about the tus server
pub fn create(&self, url: &str, path: &Path) -> Result<String, Error>
[src]
Create a file on the server, receiving the upload URL of the file.
pub fn create_with_metadata(
&self,
url: &str,
path: &Path,
metadata: HashMap<String, String>
) -> Result<String, Error>
[src]
&self,
url: &str,
path: &Path,
metadata: HashMap<String, String>
) -> Result<String, Error>
Create a file on the server including the specified metadata, receiving the upload URL of the file.
pub fn delete(&self, url: &str) -> Result<(), Error>
[src]
Delete a file on the server.
Auto Trait Implementations
impl<'a> !Sync for Client<'a>
impl<'a> !Send for Client<'a>
impl<'a> Unpin for Client<'a>
impl<'a> !RefUnwindSafe for Client<'a>
impl<'a> !UnwindSafe for Client<'a>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,