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