Struct madome_client::file::FileClient
source · [−]pub struct FileClient { /* private fields */ }
Implementations
sourceimpl FileClient
impl FileClient
pub fn new(base_url: &str) -> Self
sourcepub fn upload<P: AsRef<Path>, Buf: AsRef<[u8]>>(
&self,
token: &String,
url_path: P,
buf: Buf
) -> Result<()>
pub fn upload<P: AsRef<Path>, Buf: AsRef<[u8]>>(
&self,
token: &String,
url_path: P,
buf: Buf
) -> Result<()>
Aurguments
- url_path: don’t add slash to front
example
use madome_client::FileClient;
let token = String::from("");
let file_client = FileClient::new("https:://abcd.bcda");
let buf = std::fs::read("./.temp/1234/0.jpg").unwrap();
file_client.upload(&token, "image/library/1234/0.jpg", buf);
Auto Trait Implementations
impl !RefUnwindSafe for FileClient
impl Send for FileClient
impl Sync for FileClient
impl Unpin for FileClient
impl !UnwindSafe for FileClient
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more