Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 3fd6c28

Browse files
Document new APIs
1 parent b3f0e98 commit 3fd6c28

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/client.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,7 @@ pub trait FilesystemClient: PollClient {
622622
self.request(request::ReadFile { location, path })
623623
}
624624

625+
// Read part of a file, up to 1KiB starting at `pos`
625626
fn read_file_chunk(
626627
&mut self,
627628
location: Location,
@@ -674,6 +675,10 @@ pub trait FilesystemClient: PollClient {
674675
})
675676
}
676677

678+
/// Begin writing a file that can be larger than 1KiB
679+
///
680+
/// More chunks can be written with [`write_file_chunk`](FilesystemClient::write_file_chunk).
681+
/// Before the data becomes readable, it needs to be flushed with [`flush_chunks`](FilesystemClient::flush_chunks), or aborted with [`abort_chunked_write`](FilesystemClient::abort_chunked_write)
677682
fn start_chunked_write(
678683
&mut self,
679684
location: Location,
@@ -689,6 +694,9 @@ pub trait FilesystemClient: PollClient {
689694
})
690695
}
691696

697+
/// Write part of a file
698+
///
699+
/// See [`start_chunked_write`](FilesystemClient::start_chunked_write).
692700
fn write_file_chunk(
693701
&mut self,
694702
location: Location,
@@ -703,6 +711,9 @@ pub trait FilesystemClient: PollClient {
703711
pos,
704712
})
705713
}
714+
715+
/// Flush a file opened with [`start_chunked_write`](FilesystemClient::start_chunked_write).
716+
/// Only after this will the content of the file be readable
706717
fn flush_chunks(
707718
&mut self,
708719
location: Location,
@@ -711,6 +722,7 @@ pub trait FilesystemClient: PollClient {
711722
self.request(request::FlushChunks { location, path })
712723
}
713724

725+
/// Abort writes to a file opened with [`start_chunked_write`](FilesystemClient::start_chunked_write).
714726
fn abort_chunked_write(
715727
&mut self,
716728
location: Location,

0 commit comments

Comments
 (0)