pub struct RefUri { /* private fields */ }Expand description
Parsed representation of a $ref URI for resolution.
Supports same-document (#/…), relative (./other.yaml), and absolute (https://…, file:///…) references.
Implementations§
Source§impl RefUri
impl RefUri
Sourcepub fn is_same_document(&self) -> bool
pub fn is_same_document(&self) -> bool
Returns true if this is a same-document reference (starts with #).
Sourcepub fn is_absolute(&self) -> bool
pub fn is_absolute(&self) -> bool
Returns true if the base part of the reference is an absolute URI (has a scheme).
Sourcepub fn fragment(&self) -> Option<&str>
pub fn fragment(&self) -> Option<&str>
Returns the JSON Pointer fragment (e.g. “/$defs/foo”) if present.
Sourcepub fn resolve_against(&self, base: &Url) -> Result<Url>
pub fn resolve_against(&self, base: &Url) -> Result<Url>
Resolve this reference against a base URL (RFC 3986). For same-document refs, returns an error (use fragment resolution instead). For relative refs, joins with base. For absolute refs, parses and optionally appends fragment.
Trait Implementations§
impl StructuralPartialEq for RefUri
Auto Trait Implementations§
impl Freeze for RefUri
impl RefUnwindSafe for RefUri
impl Send for RefUri
impl Sync for RefUri
impl Unpin for RefUri
impl UnsafeUnpin for RefUri
impl UnwindSafe for RefUri
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