pub struct FileContentRequest { /* private fields */ }Expand description
File content request (GET /paas/v4/files/{file_id}/content)
Implementations§
Source§impl FileContentRequest
impl FileContentRequest
Sourcepub fn new(file_id: impl Into<String>) -> Self
pub fn new(file_id: impl Into<String>) -> Self
Create a new content request for the given file id.
Sourcepub async fn send_via(&self, client: &ZaiClient) -> ZaiResult<ByteStream>
pub async fn send_via(&self, client: &ZaiClient) -> ZaiResult<ByteStream>
Send the request via a ZaiClient and return raw bytes of the file
content.
Sourcepub async fn send_to_via<P: AsRef<Path>>(
&self,
client: &ZaiClient,
path: P,
) -> ZaiResult<usize>
pub async fn send_to_via<P: AsRef<Path>>( &self, client: &ZaiClient, path: P, ) -> ZaiResult<usize>
Send via a ZaiClient and write the file content to path.
Parent directories are created when missing. The response is buffered, written to a private same-directory temporary file, synced, and then published atomically. An existing destination is never replaced. Returns the number of bytes written.
Auto Trait Implementations§
impl Freeze for FileContentRequest
impl RefUnwindSafe for FileContentRequest
impl Send for FileContentRequest
impl Sync for FileContentRequest
impl Unpin for FileContentRequest
impl UnsafeUnpin for FileContentRequest
impl UnwindSafe for FileContentRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more