#[non_exhaustive]pub enum UrlTarget {
Object(Hash),
#[non_exhaustive] Path {
reference: String,
path: String,
},
}Expand description
What IssueObjectUrl binds a token to (§9.4 target).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Object(Hash)
object:<64 lowercase hex object id>.
#[non_exhaustive]Path
path:<full ref name>:<unpadded base64url of the UTF-8 path>; the
decoded path names a tree entry, empty the root tree. Built only
through UrlTarget::path, which enforces the §9.4 grammar.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
Implementations§
Source§impl UrlTarget
impl UrlTarget
Sourcepub fn path(
reference: impl Into<String>,
path: impl Into<String>,
) -> Result<Self, TargetError>
pub fn path( reference: impl Into<String>, path: impl Into<String>, ) -> Result<Self, TargetError>
A path target after checking the ref name and the §9.4 path rules.
§Errors
TargetError for an invalid ref name, a path over
MAX_PATH_BYTES bytes, or a nonempty path with a leading,
trailing or repeated / or a ./.. entry.
Sourcepub fn parse_field(field: &str) -> Result<Self, TargetError>
pub fn parse_field(field: &str) -> Result<Self, TargetError>
Parse a target field. Ref names contain no :, so the field
splits at its first two.
§Errors
TargetError for anything Self::field does not produce.
Trait Implementations§
impl Eq for UrlTarget
impl StructuralPartialEq for UrlTarget
Auto Trait Implementations§
impl Freeze for UrlTarget
impl RefUnwindSafe for UrlTarget
impl Send for UrlTarget
impl Sync for UrlTarget
impl Unpin for UrlTarget
impl UnsafeUnpin for UrlTarget
impl UnwindSafe for UrlTarget
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
Mutably borrows from an owned value. Read more