Struct deno_ast::StartSourcePos
source · pub struct StartSourcePos(_);
Expand description
A special source pos that indicates the source start which functions can use as a parameter type in order to ensure someone doesn’t provide the wrong position.
Implementations
sourceimpl StartSourcePos
impl StartSourcePos
sourcepub const START_SOURCE_POS: StartSourcePos = StartSourcePos(SourcePos(BytePos(1)))
pub const START_SOURCE_POS: StartSourcePos = StartSourcePos(SourcePos(BytePos(1)))
Use this value as the start byte position when parsing.
pub fn as_byte_pos(&self) -> BytePos
pub fn as_source_pos(&self) -> SourcePos
Trait Implementations
sourceimpl Add<usize> for StartSourcePos
impl Add<usize> for StartSourcePos
sourceimpl Clone for StartSourcePos
impl Clone for StartSourcePos
sourcefn clone(&self) -> StartSourcePos
fn clone(&self) -> StartSourcePos
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for StartSourcePos
impl Debug for StartSourcePos
sourceimpl Display for StartSourcePos
impl Display for StartSourcePos
sourceimpl Hash for StartSourcePos
impl Hash for StartSourcePos
sourceimpl Into<SourcePos> for StartSourcePos
impl Into<SourcePos> for StartSourcePos
sourceimpl Ord for StartSourcePos
impl Ord for StartSourcePos
sourcefn cmp(&self, other: &StartSourcePos) -> Ordering
fn cmp(&self, other: &StartSourcePos) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<StartSourcePos> for SourcePos
impl PartialEq<StartSourcePos> for SourcePos
sourcefn eq(&self, other: &StartSourcePos) -> bool
fn eq(&self, other: &StartSourcePos) -> bool
sourceimpl PartialEq<StartSourcePos> for StartSourcePos
impl PartialEq<StartSourcePos> for StartSourcePos
sourcefn eq(&self, other: &StartSourcePos) -> bool
fn eq(&self, other: &StartSourcePos) -> bool
sourceimpl PartialOrd<SourcePos> for StartSourcePos
impl PartialOrd<SourcePos> for StartSourcePos
sourcefn partial_cmp(&self, other: &SourcePos) -> Option<Ordering>
fn partial_cmp(&self, other: &SourcePos) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl PartialOrd<StartSourcePos> for SourcePos
impl PartialOrd<StartSourcePos> for SourcePos
sourcefn partial_cmp(&self, other: &StartSourcePos) -> Option<Ordering>
fn partial_cmp(&self, other: &StartSourcePos) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl PartialOrd<StartSourcePos> for StartSourcePos
impl PartialOrd<StartSourcePos> for StartSourcePos
sourcefn partial_cmp(&self, other: &StartSourcePos) -> Option<Ordering>
fn partial_cmp(&self, other: &StartSourcePos) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl Sub<StartSourcePos> for SourcePos
impl Sub<StartSourcePos> for SourcePos
sourcefn sub(self, rhs: StartSourcePos) -> <SourcePos as Sub<StartSourcePos>>::Output
fn sub(self, rhs: StartSourcePos) -> <SourcePos as Sub<StartSourcePos>>::Output
Performs the
-
operation. Read moreimpl Copy for StartSourcePos
impl Eq for StartSourcePos
impl StructuralEq for StartSourcePos
impl StructuralPartialEq for StartSourcePos
Auto Trait Implementations
impl RefUnwindSafe for StartSourcePos
impl Send for StartSourcePos
impl Sync for StartSourcePos
impl Unpin for StartSourcePos
impl UnwindSafe for StartSourcePos
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.