pub struct RelSourceLoc(/* private fields */);
Expand description
Source location relative to another base source location.
Implementations§
Source§impl RelSourceLoc
impl RelSourceLoc
Sourcepub fn from_base_offset(base: SourceLoc, offset: SourceLoc) -> Self
pub fn from_base_offset(base: SourceLoc, offset: SourceLoc) -> Self
Creates a new RelSourceLoc
based on the given base and offset.
Sourcepub fn expand(&self, base: SourceLoc) -> SourceLoc
pub fn expand(&self, base: SourceLoc) -> SourceLoc
Expands the relative source location into an absolute one, using the given base.
Sourcepub fn is_default(self) -> bool
pub fn is_default(self) -> bool
Is this the default relative source location?
Trait Implementations§
Source§impl Clone for RelSourceLoc
impl Clone for RelSourceLoc
Source§fn clone(&self) -> RelSourceLoc
fn clone(&self) -> RelSourceLoc
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for RelSourceLoc
impl Debug for RelSourceLoc
Source§impl Default for RelSourceLoc
impl Default for RelSourceLoc
Source§impl<'de> Deserialize<'de> for RelSourceLoc
impl<'de> Deserialize<'de> for RelSourceLoc
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for RelSourceLoc
impl Display for RelSourceLoc
Source§impl Hash for RelSourceLoc
impl Hash for RelSourceLoc
Source§impl PartialEq for RelSourceLoc
impl PartialEq for RelSourceLoc
Source§impl Serialize for RelSourceLoc
impl Serialize for RelSourceLoc
impl Copy for RelSourceLoc
impl Eq for RelSourceLoc
impl StructuralPartialEq for RelSourceLoc
Auto Trait Implementations§
impl Freeze for RelSourceLoc
impl RefUnwindSafe for RelSourceLoc
impl Send for RelSourceLoc
impl Sync for RelSourceLoc
impl Unpin for RelSourceLoc
impl UnwindSafe for RelSourceLoc
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more