pub struct DataObject { /* private fields */ }Expand description
A global’s bytes and the addresses stored in them.
§Examples
use backend_lang::Options;
use ir_lang::{Global, Module};
let mut m = Module::new("m");
let _ = m.declare_global("answer", Global::bytes(&[42, 0, 0, 0], 4))?;
let c = backend_lang::compile(&m, &Options::sysv())?;
let d = &c.data()[0];
assert_eq!((d.name(), d.size(), d.align()), ("answer", 4, 4));
assert_eq!(d.bytes(), Some(&[42u8, 0, 0, 0][..]));Implementations§
Trait Implementations§
Source§impl Clone for DataObject
impl Clone for DataObject
Source§impl Debug for DataObject
impl Debug for DataObject
impl Eq for DataObject
Source§impl PartialEq for DataObject
impl PartialEq for DataObject
impl StructuralPartialEq for DataObject
Auto Trait Implementations§
impl Freeze for DataObject
impl RefUnwindSafe for DataObject
impl Send for DataObject
impl Sync for DataObject
impl Unpin for DataObject
impl UnsafeUnpin for DataObject
impl UnwindSafe for DataObject
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