Add seek function
This commit is contained in:
parent
d0c5f8b706
commit
75b12fdac4
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -63,6 +63,9 @@ name = "bitflags"
|
||||
version = "2.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "byteorder"
|
||||
@ -128,6 +131,7 @@ checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d"
|
||||
name = "file_rpc"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"parking_lot",
|
||||
"postcard",
|
||||
"serde",
|
||||
|
@ -350,14 +350,13 @@ impl file_rpc::Server for FileServ {
|
||||
fn read(
|
||||
&self,
|
||||
_fd: u64,
|
||||
_pos: u64,
|
||||
_len: usize,
|
||||
) -> std::result::Result<std::borrow::Cow<'_, [u8]>, ()> {
|
||||
Err(())
|
||||
}
|
||||
|
||||
#[allow(clippy::significant_drop_tightening)]
|
||||
fn write(&self, _fd: u64, _pos: u64, data: &[u8]) -> Result<(), ()> {
|
||||
fn write(&self, _fd: u64, data: &[u8]) -> Result<(), ()> {
|
||||
let string = str::from_utf8(data).map_err(|_| ())?;
|
||||
let mut fbwriter = self.fbwriter.lock();
|
||||
let mut fbuffer = self.fbuffer.lock();
|
||||
@ -375,6 +374,8 @@ impl file_rpc::Server for FileServ {
|
||||
fn dup(&self, fd: u64) -> Option<u64> {
|
||||
Some(fd)
|
||||
}
|
||||
|
||||
fn seek(&self, _fd: u64, _pos: file_rpc::SeekFrom) -> u64 { 0 }
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
Loading…
Reference in New Issue
Block a user