pub struct ChecksumFile {
pub package_name: String,
}
Fields§
§package_name: String
Implementations§
Source§impl ChecksumFile
impl ChecksumFile
pub fn new(package_name: &str) -> Self
pub fn exists_at(&self, path: &Path) -> bool
Sourcepub fn read_from(&self, path: &Path) -> Result<String>
pub fn read_from(&self, path: &Path) -> Result<String>
Reads the checksum from the given file path if it exists.
Sourcepub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
pub fn write_to(&self, path: &Path, checksum: String) -> Result<()>
Writes the given checksum to a file.
Sourcepub fn remove(&self, path: &Path) -> Result<bool>
pub fn remove(&self, path: &Path) -> Result<bool>
Removes the checksum at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
fn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ChecksumFile
impl<'de> Deserialize<'de> for ChecksumFile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ChecksumFile
impl RefUnwindSafe for ChecksumFile
impl Send for ChecksumFile
impl Sync for ChecksumFile
impl Unpin for ChecksumFile
impl UnwindSafe for ChecksumFile
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
§impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
fn take_from_value<D>(
value: &mut Value,
field: &str,
) -> Result<T, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more