Enum libpijul_compat::patch::Patch
source · pub enum Patch {
Unsigned0,
Signed0,
Unsigned(UnsignedPatch),
}
Expand description
The definition of a patch.
Variants§
Implementations§
source§impl Patch
impl Patch
sourcepub fn changes(&self) -> &[Change<ChangeContext<Hash>>]
pub fn changes(&self) -> &[Change<ChangeContext<Hash>>]
The contents of this patch.
pub fn changes_mut(&mut self) -> &mut Vec<Change<ChangeContext<Hash>>> ⓘ
sourcepub fn dependencies(&self) -> &HashSet<Hash>
pub fn dependencies(&self) -> &HashSet<Hash>
The dependencies of this patch.
pub fn dependencies_mut(&mut self) -> &mut HashSet<Hash>
sourcepub fn header(&self) -> &PatchHeader
pub fn header(&self) -> &PatchHeader
The header of this patch.
pub fn header_mut(&mut self) -> &mut PatchHeader
source§impl Patch
impl Patch
sourcepub fn size_upper_bound(&self) -> usize
pub fn size_upper_bound(&self) -> usize
An approximate upper bound of the number of extra bytes in the database this patch might require. This depends a lot on the patch and the database, so it might be wrong.
pub fn is_tag(&self) -> bool
sourcepub fn from_reader_compressed<R: BufRead>(
r: &mut R
) -> Result<(Hash, Vec<u8>, Patch)>
pub fn from_reader_compressed<R: BufRead>(
r: &mut R
) -> Result<(Hash, Vec<u8>, Patch)>
Read one patch from a gzip-compressed BufRead
. If several
patches are available in the same BufRead
, this method can
be called again.
pub fn to_buf(&self) -> Result<(Vec<u8>, Hash)>
sourcepub fn save<P: AsRef<Path>>(&self, dir: P, key: Option<&KeyPair>) -> Result<Hash>
pub fn save<P: AsRef<Path>>(&self, dir: P, key: Option<&KeyPair>) -> Result<Hash>
Save the patch, computing the hash.
pub fn inverse(&self, hash: &Hash, changes: &mut Vec<Change<ChangeContext<Hash>>>)
Trait Implementations§
source§impl<'de> Deserialize<'de> for Patch
impl<'de> Deserialize<'de> for Patch
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