pub struct Chunker { /* private fields */ }
Implementations§
Source§impl Chunker
impl Chunker
pub fn new(cache: InMemoryCache, base_path: PathBuf) -> Chunker
pub async fn hashify(&mut self, path: &str) -> Result<Vec<String>, SyncError>
pub fn hash(&self, data: &Vec<u8>, size: usize) -> String
pub fn exists(&mut self, path: &str) -> bool
pub async fn save( &mut self, path: &str, hashes: Vec<&str>, ) -> Result<(), SyncError>
pub async fn delete(&mut self, path: &str) -> Result<(), SyncError>
pub fn read_chunk(&self, chunk_hash: &str) -> Result<Vec<u8>, SyncError>
pub fn save_chunk( &mut self, chunk_hash: &str, content: Vec<u8>, ) -> Result<(), SyncError>
pub fn check_chunk(&self, chunk_hash: &str) -> bool
Auto Trait Implementations§
impl Freeze for Chunker
impl !RefUnwindSafe for Chunker
impl Send for Chunker
impl Sync for Chunker
impl Unpin for Chunker
impl !UnwindSafe for Chunker
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
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self
to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self
to an expression for Diesel’s query builder. Read more