pub struct Target { /* private fields */ }Expand description
Re-exported for callers who want to talk to git-meta directly. A resolved metadata target consisting of a type and an optional value.
Implementations§
Source§impl Target
impl Target
Sourcepub fn from_parts(target_type: TargetType, value: Option<String>) -> Target
pub fn from_parts(target_type: TargetType, value: Option<String>) -> Target
Create a target from raw parts.
This is a low-level constructor used when the target type and value are
already known (e.g., when reconstructing targets from database rows or
parsed tree entries). For user-facing construction, prefer the named
constructors (commit(), project(), etc.)
or parse().
§Parameters
target_type: the kind of targetvalue: the target value, orNonefor project targets
Sourcepub fn parse(s: &str) -> Result<Target, Error>
pub fn parse(s: &str) -> Result<Target, Error>
Parse a target from a string in type:value format (e.g. "commit:abc123").
This is the CLI-oriented constructor. For programmatic use, prefer the
named constructors: commit(), project(),
path(), branch(), change_id().
§Parameters
s: the target string intype:valueformat, or"project"for project targets.
§Errors
Returns an error if the format is invalid, the target type is unknown, or the value is shorter than 3 characters.
Sourcepub fn target_type(&self) -> &TargetType
pub fn target_type(&self) -> &TargetType
The type of this target (commit, branch, path, etc.).
Trait Implementations§
impl Eq for Target
impl StructuralPartialEq for Target
Auto Trait Implementations§
impl Freeze for Target
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnsafeUnpin for Target
impl UnwindSafe for Target
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.