pub struct WorkspacePatchExecutionEvidence { /* private fields */ }Expand description
Execute-time metadata for a constrained workspace patch.
This stores one or more file changes. It intentionally does not store old or new text.
Implementations§
Source§impl WorkspacePatchExecutionEvidence
impl WorkspacePatchExecutionEvidence
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 execute-time metadata for a single workspace patch.
Sourcepub fn from_changes(
changes: Vec<WorkspacePatchChangeEvidence>,
) -> Result<Self, ActionProposalError>
pub fn from_changes( changes: Vec<WorkspacePatchChangeEvidence>, ) -> Result<Self, ActionProposalError>
Creates execute-time metadata for a multi-file workspace patch.
Sourcepub fn changes(&self) -> &[WorkspacePatchChangeEvidence]
pub fn changes(&self) -> &[WorkspacePatchChangeEvidence]
Returns all file changes included in this patch.
Sourcepub fn relative_path(&self) -> &str
pub fn relative_path(&self) -> &str
Returns the first changed path using / separators.
Sourcepub fn preimage_bytes(&self) -> usize
pub fn preimage_bytes(&self) -> usize
Returns the byte length of the first matched preimage.
Sourcepub fn replacement_bytes(&self) -> usize
pub fn replacement_bytes(&self) -> usize
Returns the byte length of the first replacement text.
Sourcepub fn file_bytes_before(&self) -> usize
pub fn file_bytes_before(&self) -> usize
Returns the first file size immediately before replacement.
Sourcepub fn file_bytes_after(&self) -> usize
pub fn file_bytes_after(&self) -> usize
Returns the first 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 first stable non-cryptographic fingerprint before replacement.
Sourcepub fn file_fingerprint_after(&self) -> &str
pub fn file_fingerprint_after(&self) -> &str
Returns the first stable non-cryptographic fingerprint after replacement.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for WorkspacePatchExecutionEvidence
impl<'de> Deserialize<'de> for WorkspacePatchExecutionEvidence
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 WorkspacePatchExecutionEvidence
impl StructuralPartialEq for WorkspacePatchExecutionEvidence
Auto Trait Implementations§
impl Forget for WorkspacePatchExecutionEvidence
impl Freeze for WorkspacePatchExecutionEvidence
impl Move for WorkspacePatchExecutionEvidence
impl RefUnwindSafe for WorkspacePatchExecutionEvidence
impl Send for WorkspacePatchExecutionEvidence
impl Sync for WorkspacePatchExecutionEvidence
impl Unpin for WorkspacePatchExecutionEvidence
impl UnsafeUnpin for WorkspacePatchExecutionEvidence
impl UnwindSafe for WorkspacePatchExecutionEvidence
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.