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
Auto Trait Implementations§
impl Freeze for Patch
impl RefUnwindSafe for Patch
impl Send for Patch
impl Sync for Patch
impl Unpin for Patch
impl UnwindSafe for Patch
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