pub struct PointerU128(/* private fields */);
Expand description
Pointer
implementation for u128
.
Implementations§
Source§impl PointerU128
impl PointerU128
Sourcepub fn new(value: usize) -> Option<Self>
pub fn new(value: usize) -> Option<Self>
Safe constructor for the pointer.
Returns None
if the value provided is out of bounds for the pointer type.
§Examples
use syntree::pointer::Pointer;
use syntree::pointer::PointerU128;
let v = PointerU128::new(0).ok_or("out of bounds")?;
assert_eq!(v.get(), 0);
let v = PointerU128::new(42).ok_or("out of bounds")?;
assert_eq!(v.get(), 42);
Trait Implementations§
Source§impl Clone for PointerU128
impl Clone for PointerU128
Source§fn clone(&self) -> PointerU128
fn clone(&self) -> PointerU128
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 PointerU128
impl Debug for PointerU128
Source§impl Default for PointerU128
Construct a default value.
impl Default for PointerU128
Construct a default value.
use syntree::pointer::Pointer;
use syntree::pointer::PointerU128;
let v = PointerU128::default();
assert_eq!(v.get(), 0);
Source§impl Hash for PointerU128
impl Hash for PointerU128
Source§impl Ord for PointerU128
impl Ord for PointerU128
Source§fn cmp(&self, other: &PointerU128) -> Ordering
fn cmp(&self, other: &PointerU128) -> 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 for PointerU128
impl PartialEq for PointerU128
Source§impl PartialOrd for PointerU128
impl PartialOrd for PointerU128
Source§impl Pointer for PointerU128
Pointer used for u128
type.
impl Pointer for PointerU128
Pointer used for u128
type.
use syntree::pointer::Pointer;
use syntree::pointer::PointerU128;
let v = PointerU128::new(0).ok_or("out of bounds")?;
assert_eq!(v.get(), 0);
let v = PointerU128::new(42).ok_or("out of bounds")?;
assert_eq!(v.get(), 42);
impl Copy for PointerU128
impl Eq for PointerU128
impl StructuralPartialEq for PointerU128
Auto Trait Implementations§
impl Freeze for PointerU128
impl RefUnwindSafe for PointerU128
impl Send for PointerU128
impl Sync for PointerU128
impl Unpin for PointerU128
impl UnwindSafe for PointerU128
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