pub struct WorkspacePatchChangeEvidence { /* private fields */ }Expand description
Per-file metadata for a constrained workspace patch change.
This stores only file identity, byte counts, and stable non-cryptographic content fingerprints. It does not store old or new text.
Implementations§
Source§impl WorkspacePatchChangeEvidence
impl WorkspacePatchChangeEvidence
Sourcepub fn new(
relative_path: impl Into<String>,
preimage_bytes: usize,
replacement_bytes: usize,
file_bytes_before: usize,
file_bytes_after: usize,
file_fingerprint_before: impl Into<String>,
file_fingerprint_after: impl Into<String>,
) -> Result<Self, ActionProposalError>
pub fn new( relative_path: impl Into<String>, preimage_bytes: usize, replacement_bytes: usize, file_bytes_before: usize, file_bytes_after: usize, file_fingerprint_before: impl Into<String>, file_fingerprint_after: impl Into<String>, ) -> Result<Self, ActionProposalError>
Creates validated metadata for one file change in a workspace patch.
Sourcepub fn relative_path(&self) -> &str
pub fn relative_path(&self) -> &str
Returns the changed path using / separators.
The value stays workspace-relative while the change is below a configured root, and is the absolute path the caller named when it is not.
Sourcepub fn preimage_bytes(&self) -> usize
pub fn preimage_bytes(&self) -> usize
Returns the byte length of the matched preimage.
Sourcepub fn replacement_bytes(&self) -> usize
pub fn replacement_bytes(&self) -> usize
Returns the byte length of the replacement text.
Sourcepub fn file_bytes_before(&self) -> usize
pub fn file_bytes_before(&self) -> usize
Returns the file size immediately before replacement.
Sourcepub fn file_bytes_after(&self) -> usize
pub fn file_bytes_after(&self) -> usize
Returns the file size observed after replacement was written and read back.
Sourcepub fn file_fingerprint_before(&self) -> &str
pub fn file_fingerprint_before(&self) -> &str
Returns the stable non-cryptographic fingerprint before replacement.
Sourcepub fn file_fingerprint_after(&self) -> &str
pub fn file_fingerprint_after(&self) -> &str
Returns the stable non-cryptographic fingerprint after replacement.
Trait Implementations§
Source§impl Clone for WorkspacePatchChangeEvidence
impl Clone for WorkspacePatchChangeEvidence
Source§impl Debug for WorkspacePatchChangeEvidence
impl Debug for WorkspacePatchChangeEvidence
Source§impl<'de> Deserialize<'de> for WorkspacePatchChangeEvidence
impl<'de> Deserialize<'de> for WorkspacePatchChangeEvidence
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>,
impl Eq for WorkspacePatchChangeEvidence
impl StructuralPartialEq for WorkspacePatchChangeEvidence
Auto Trait Implementations§
impl Forget for WorkspacePatchChangeEvidence
impl Freeze for WorkspacePatchChangeEvidence
impl Move for WorkspacePatchChangeEvidence
impl RefUnwindSafe for WorkspacePatchChangeEvidence
impl Send for WorkspacePatchChangeEvidencewhere
RawVecInner: Send,
impl Sync for WorkspacePatchChangeEvidencewhere
RawVecInner: Sync,
impl Unpin for WorkspacePatchChangeEvidence
impl UnsafeUnpin for WorkspacePatchChangeEvidence
impl UnwindSafe for WorkspacePatchChangeEvidencewhere
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.