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