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 more
sourceimpl 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
sourceimpl PartialEq<SourcePos> for StartSourcePos
impl PartialEq<SourcePos> for StartSourcePos
sourceimpl PartialEq<StartSourcePos> for SourcePos
impl PartialEq<StartSourcePos> for SourcePos
sourceimpl PartialEq<StartSourcePos> for StartSourcePos
impl PartialEq<StartSourcePos> for StartSourcePos
sourcefn eq(&self, other: &StartSourcePos) -> bool
fn eq(&self, other: &StartSourcePos) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &StartSourcePos) -> bool
fn ne(&self, other: &StartSourcePos) -> bool
This method tests for !=
.
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>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
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 more
sourceimpl 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>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
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 more
sourceimpl 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>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
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 more
sourceimpl 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 more
impl 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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 Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
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.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more