pub struct Client { /* private fields */ }
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(host: String, port: u16, timeout: Duration) -> Result<Client>
pub fn new(host: String, port: u16, timeout: Duration) -> Result<Client>
Examples found in repository?
examples/client.rs (line 9)
7async fn main() {
8 let path = "/test_path";
9 let c = client::Client::new("localhost".to_string(), 39999, Duration::from_secs(10)).unwrap();
10
11 let r = c.exists(path, option::Exists).await.unwrap();
12 let s = "123";
13 let d = s.as_bytes();
14 let buf = BufReader::new(d);
15 let id = c
16 .create_file(path, option::CreateFile::default())
17 .await
18 .unwrap();
19 c.write(id, BufReader::new(buf)).await.unwrap();
20 c.close(id).await.unwrap();
21 println!("{} {}", r, id);
22}
Sourcepub async fn write<'a, I>(&'a self, id: i64, input: I) -> Result<i64>
pub async fn write<'a, I>(&'a self, id: i64, input: I) -> Result<i64>
Examples found in repository?
examples/client.rs (line 19)
7async fn main() {
8 let path = "/test_path";
9 let c = client::Client::new("localhost".to_string(), 39999, Duration::from_secs(10)).unwrap();
10
11 let r = c.exists(path, option::Exists).await.unwrap();
12 let s = "123";
13 let d = s.as_bytes();
14 let buf = BufReader::new(d);
15 let id = c
16 .create_file(path, option::CreateFile::default())
17 .await
18 .unwrap();
19 c.write(id, BufReader::new(buf)).await.unwrap();
20 c.close(id).await.unwrap();
21 println!("{} {}", r, id);
22}
Sourcepub async fn close(&self, id: i64) -> Result<()>
pub async fn close(&self, id: i64) -> Result<()>
Examples found in repository?
examples/client.rs (line 20)
7async fn main() {
8 let path = "/test_path";
9 let c = client::Client::new("localhost".to_string(), 39999, Duration::from_secs(10)).unwrap();
10
11 let r = c.exists(path, option::Exists).await.unwrap();
12 let s = "123";
13 let d = s.as_bytes();
14 let buf = BufReader::new(d);
15 let id = c
16 .create_file(path, option::CreateFile::default())
17 .await
18 .unwrap();
19 c.write(id, BufReader::new(buf)).await.unwrap();
20 c.close(id).await.unwrap();
21 println!("{} {}", r, id);
22}
pub async fn read(&self, id: i64) -> Result<impl AsyncRead>
Source§impl Client
impl Client
pub async fn create_directory( &self, path: &str, options: CreateDirectory, ) -> Result<()>
Sourcepub async fn create_file(&self, path: &str, options: CreateFile) -> Result<i64>
pub async fn create_file(&self, path: &str, options: CreateFile) -> Result<i64>
Examples found in repository?
examples/client.rs (line 16)
7async fn main() {
8 let path = "/test_path";
9 let c = client::Client::new("localhost".to_string(), 39999, Duration::from_secs(10)).unwrap();
10
11 let r = c.exists(path, option::Exists).await.unwrap();
12 let s = "123";
13 let d = s.as_bytes();
14 let buf = BufReader::new(d);
15 let id = c
16 .create_file(path, option::CreateFile::default())
17 .await
18 .unwrap();
19 c.write(id, BufReader::new(buf)).await.unwrap();
20 c.close(id).await.unwrap();
21 println!("{} {}", r, id);
22}
pub async fn delete(&self, path: &str, options: Delete) -> Result<()>
Sourcepub async fn exists(&self, path: &str, options: Exists) -> Result<bool>
pub async fn exists(&self, path: &str, options: Exists) -> Result<bool>
Examples found in repository?
examples/client.rs (line 11)
7async fn main() {
8 let path = "/test_path";
9 let c = client::Client::new("localhost".to_string(), 39999, Duration::from_secs(10)).unwrap();
10
11 let r = c.exists(path, option::Exists).await.unwrap();
12 let s = "123";
13 let d = s.as_bytes();
14 let buf = BufReader::new(d);
15 let id = c
16 .create_file(path, option::CreateFile::default())
17 .await
18 .unwrap();
19 c.write(id, BufReader::new(buf)).await.unwrap();
20 c.close(id).await.unwrap();
21 println!("{} {}", r, id);
22}
pub async fn free(&self, path: &str, options: Free) -> Result<()>
pub async fn get_status( &self, path: &str, options: GetStatus, ) -> Result<FileInfo>
pub async fn list_status( &self, path: &str, options: ListStatus, ) -> Result<FileInfos>
pub async fn mount(&self, path: &str, src: &str, options: Mount) -> Result<()>
pub async fn open_file(&self, path: &str, options: OpenFile) -> Result<i64>
pub async fn rename(&self, path: &str, dst: &str, options: Rename) -> Result<()>
pub async fn set_attribute( &self, path: &str, options: SetAttribute, ) -> Result<()>
pub async fn unmount(&self, path: &str, options: Unmount) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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