[−][src]Struct libquilt::UnidentifiedPatch
Like a Patch
, but without the unique id.
A patch is ultimately identified by its id, which is generated by hashing the contents of the serialized patch. This ends up being a bit circular, because the contents of the patch might actually depend on the id, and those contents in turn will affect the id. The way we break this cycle is by separating "unidentified" patches (those without an id yet) from completed patches with an id.
This is an unidentified patch; it does not have an id field, and any changes that need
to refer to contents of this patch use the placeholder id returned by PatchId::cur
.
This patch cannot be applied to a repository, because doing so would require an id. However, it can be serialized to a file, and it can be turned into an identified patch.
Methods
impl UnidentifiedPatch
[src]
pub fn new(
author: String,
description: String,
changes: Changes
) -> UnidentifiedPatch
[src]
author: String,
description: String,
changes: Changes
) -> UnidentifiedPatch
Creates a new UnidentifiedPatch
from some metadata and a set of changes.
pub fn write_out<W: Write>(self, writer: W) -> Result<Patch, Error>
[src]
Writes out a patch.
While writing out the patch, we compute the hash of its contents and use that to derive an
id for this patch. Assuming that the writing succeeds, we return the resulting Patch
.
Trait Implementations
impl Clone for UnidentifiedPatch
[src]
fn clone(&self) -> UnidentifiedPatch
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for UnidentifiedPatch
[src]
impl PartialEq<UnidentifiedPatch> for UnidentifiedPatch
[src]
fn eq(&self, other: &UnidentifiedPatch) -> bool
[src]
fn ne(&self, other: &UnidentifiedPatch) -> bool
[src]
impl Debug for UnidentifiedPatch
[src]
impl Hash for UnidentifiedPatch
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<'de> Deserialize<'de> for UnidentifiedPatch
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for UnidentifiedPatch
[src]
Auto Trait Implementations
impl Send for UnidentifiedPatch
impl Sync for UnidentifiedPatch
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Same for T
type Output = T
Should always be Self