pub struct WorkspacePatchProposal { /* private fields */ }Expand description
Deterministic metadata for a constrained workspace patch proposal.
This stores one or more file changes needed for a future edit decision. It does not store old text, new text, host absolute paths, or provider wire data.
Implementations§
Source§impl WorkspacePatchProposal
impl WorkspacePatchProposal
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 a workspace patch file change. New-file changes use an empty preimage and a zero-byte file state before writing.
Sourcepub fn from_changes(
changes: Vec<WorkspacePatchChangeEvidence>,
) -> Result<Self, ActionProposalError>
pub fn from_changes( changes: Vec<WorkspacePatchChangeEvidence>, ) -> Result<Self, ActionProposalError>
Creates proposal 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 before replacement.
Sourcepub fn file_bytes_after(&self) -> usize
pub fn file_bytes_after(&self) -> usize
Returns the first projected file size after replacement.
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 projected stable non-cryptographic fingerprint after replacement.
Trait Implementations§
Source§impl Clone for WorkspacePatchProposal
impl Clone for WorkspacePatchProposal
Source§impl Debug for WorkspacePatchProposal
impl Debug for WorkspacePatchProposal
Source§impl<'de> Deserialize<'de> for WorkspacePatchProposal
impl<'de> Deserialize<'de> for WorkspacePatchProposal
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 WorkspacePatchProposal
Source§impl PartialEq for WorkspacePatchProposal
impl PartialEq for WorkspacePatchProposal
Source§impl Serialize for WorkspacePatchProposal
impl Serialize for WorkspacePatchProposal
impl StructuralPartialEq for WorkspacePatchProposal
Auto Trait Implementations§
impl Forget for WorkspacePatchProposal
impl Freeze for WorkspacePatchProposal
impl Move for WorkspacePatchProposal
impl RefUnwindSafe for WorkspacePatchProposal
impl Send for WorkspacePatchProposalwhere
RawVecInner: Send,
impl Sync for WorkspacePatchProposalwhere
RawVecInner: Sync,
impl Unpin for WorkspacePatchProposal
impl UnsafeUnpin for WorkspacePatchProposal
impl UnwindSafe for WorkspacePatchProposalwhere
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.