Struct rsonpath::query::NonNegativeArrayIndex
source · pub struct NonNegativeArrayIndex(/* private fields */);
Expand description
Array index to search for in a JSON document.
Represents a specific location from the front of the list in a json array. Provides the IETF-conforming index value. Values are [0, (2^53)-1].
Examples
let idx = NonNegativeArrayIndex::new(2);
assert_eq!(idx.get_index(), 2);
Implementations§
source§impl NonNegativeArrayIndex
impl NonNegativeArrayIndex
sourcepub fn try_increment(&mut self) -> Result<(), ArrayIndexError>
pub fn try_increment(&mut self) -> Result<(), ArrayIndexError>
Create a new search index from a u64.
Errors
Will return Err
if the increment causes the NonNegativeArrayIndex
to exceed the addressable IETF-conforming index value value.
Trait Implementations§
source§impl Clone for NonNegativeArrayIndex
impl Clone for NonNegativeArrayIndex
source§fn clone(&self) -> NonNegativeArrayIndex
fn clone(&self) -> NonNegativeArrayIndex
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 NonNegativeArrayIndex
impl Debug for NonNegativeArrayIndex
source§impl Display for NonNegativeArrayIndex
impl Display for NonNegativeArrayIndex
source§impl From<NonNegativeArrayIndex> for u64
impl From<NonNegativeArrayIndex> for u64
source§fn from(val: NonNegativeArrayIndex) -> Self
fn from(val: NonNegativeArrayIndex) -> Self
Converts to this type from the input type.
source§impl Ord for NonNegativeArrayIndex
impl Ord for NonNegativeArrayIndex
source§fn cmp(&self, other: &NonNegativeArrayIndex) -> Ordering
fn cmp(&self, other: &NonNegativeArrayIndex) -> Ordering
1.21.0 · source§fn 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
source§impl PartialEq<NonNegativeArrayIndex> for NonNegativeArrayIndex
impl PartialEq<NonNegativeArrayIndex> for NonNegativeArrayIndex
source§fn eq(&self, other: &NonNegativeArrayIndex) -> bool
fn eq(&self, other: &NonNegativeArrayIndex) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<NonNegativeArrayIndex> for NonNegativeArrayIndex
impl PartialOrd<NonNegativeArrayIndex> for NonNegativeArrayIndex
source§fn partial_cmp(&self, other: &NonNegativeArrayIndex) -> Option<Ordering>
fn partial_cmp(&self, other: &NonNegativeArrayIndex) -> Option<Ordering>
1.0.0 · source§fn 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 moresource§impl TryFrom<u64> for NonNegativeArrayIndex
impl TryFrom<u64> for NonNegativeArrayIndex
§type Error = ArrayIndexError
type Error = ArrayIndexError
The type returned in the event of a conversion error.
impl Copy for NonNegativeArrayIndex
impl Eq for NonNegativeArrayIndex
impl StructuralEq for NonNegativeArrayIndex
impl StructuralPartialEq for NonNegativeArrayIndex
Auto Trait Implementations§
impl RefUnwindSafe for NonNegativeArrayIndex
impl Send for NonNegativeArrayIndex
impl Sync for NonNegativeArrayIndex
impl Unpin for NonNegativeArrayIndex
impl UnwindSafe for NonNegativeArrayIndex
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