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