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