pub enum PatchSource {
Path {
path: PathBuf,
},
}Expand description
What a patch redirects the patched package to. Each variant
pairs the PatchSourceKind with its concrete data.
Rationale: keeping the variant data closed (instead of a stringly-typed “spec” string) means the resolver, fetch pipeline, and metadata view all agree on what each patch actually points at. Future kinds (artifact archive, local index reference) extend this enum explicitly.
Variants§
Path
path = "../fmt". Carries the path as written in the
declaring file. Resolution against the file’s directory
happens one layer up in the orchestration code so this
type stays free of filesystem context.
Implementations§
Source§impl PatchSource
impl PatchSource
Sourcepub fn kind(&self) -> PatchSourceKind
pub fn kind(&self) -> PatchSourceKind
Stable kind label, useful for metadata / lockfile output.
Sourcepub fn from_path_field(
package: &str,
raw_path: Option<String>,
) -> Result<PatchSource, PatchValidationError>
pub fn from_path_field( package: &str, raw_path: Option<String>, ) -> Result<PatchSource, PatchValidationError>
Build a PatchSource from a [patch] row’s path field —
the only supported patch grammar today. Requires the path,
trims it, and rejects empty / whitespace, surfacing
PatchValidationError::MissingSource on failure. Shared by
the manifest and config parsers so the path→source rule lives
next to the type; each caller keeps its own outer error
wrapping and its own package-name validation.
§Errors
Returns PatchValidationError::MissingSource when raw_path is
None or empty/whitespace-only after trimming.
Trait Implementations§
Source§impl Clone for PatchSource
impl Clone for PatchSource
Source§fn clone(&self) -> PatchSource
fn clone(&self) -> PatchSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PatchSource
impl Debug for PatchSource
Source§impl<'de> Deserialize<'de> for PatchSource
impl<'de> Deserialize<'de> for PatchSource
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>,
Source§impl PartialEq for PatchSource
impl PartialEq for PatchSource
Source§fn eq(&self, other: &PatchSource) -> bool
fn eq(&self, other: &PatchSource) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for PatchSource
impl Serialize for PatchSource
impl Eq for PatchSource
impl StructuralPartialEq for PatchSource
Auto Trait Implementations§
impl Freeze for PatchSource
impl RefUnwindSafe for PatchSource
impl Send for PatchSource
impl Sync for PatchSource
impl Unpin for PatchSource
impl UnsafeUnpin for PatchSource
impl UnwindSafe for PatchSource
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.