pub struct CodeAndId { /* private fields */ }
Expand description
The newtype contains the Code instance and the corresponding id (hash).
Implementations§
Source§impl CodeAndId
impl CodeAndId
Sourcepub fn new(code: Code) -> Self
pub fn new(code: Code) -> Self
Calculates the id (hash) of the raw binary code and creates new instance.
Sourcepub fn from_parts_unchecked(code: Code, code_id: CodeId) -> Self
pub fn from_parts_unchecked(code: Code, code_id: CodeId) -> Self
Creates the instance from the precalculated hash without checks.
Sourcepub unsafe fn from_incompatible_parts(code: Code, code_id: CodeId) -> Self
pub unsafe fn from_incompatible_parts(code: Code, code_id: CodeId) -> Self
Creates the instance from the hash and incompatible with that hash code.
§Safety
USE FOR TEST PURPOSES ONLY.
Sourcepub fn into_parts(self) -> (Code, CodeId)
pub fn into_parts(self) -> (Code, CodeId)
Decomposes this instance.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CodeAndId
impl RefUnwindSafe for CodeAndId
impl Send for CodeAndId
impl Sync for CodeAndId
impl Unpin for CodeAndId
impl UnwindSafe for CodeAndId
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