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