pub struct FilesystemService;
Expand description
Filesystem operations service Handles reading/writing documents to disk and computing file hashes
Implementations§
Source§impl FilesystemService
impl FilesystemService
Sourcepub fn write_file<P: AsRef<Path>>(path: P, content: &str) -> Result<()>
pub fn write_file<P: AsRef<Path>>(path: P, content: &str) -> Result<()>
Write file contents to disk
Sourcepub fn file_exists<P: AsRef<Path>>(path: P) -> bool
pub fn file_exists<P: AsRef<Path>>(path: P) -> bool
Check if file exists
Sourcepub fn compute_file_hash<P: AsRef<Path>>(path: P) -> Result<String>
pub fn compute_file_hash<P: AsRef<Path>>(path: P) -> Result<String>
Compute SHA256 hash of file contents
Sourcepub fn compute_content_hash(content: &str) -> String
pub fn compute_content_hash(content: &str) -> String
Compute SHA256 hash of string content
Auto Trait Implementations§
impl Freeze for FilesystemService
impl RefUnwindSafe for FilesystemService
impl Send for FilesystemService
impl Sync for FilesystemService
impl Unpin for FilesystemService
impl UnwindSafe for FilesystemService
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> 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