Struct ethcontract_common::bytecode::Bytecode
source · pub struct Bytecode(_);
Expand description
The string representation of the byte code. Note that this must be a
String
since solc
linking requires string manipulation of the
bytecode string representation.
Implementations
sourceimpl Bytecode
impl Bytecode
sourcepub fn from_hex_str(s: &str) -> Result<Self, BytecodeError>
pub fn from_hex_str(s: &str) -> Result<Self, BytecodeError>
Reads hex bytecode representation from a string slice.
sourcepub fn link<S>(&mut self, name: S, address: Address) -> Result<(), LinkError>where
S: AsRef<str>,
pub fn link<S>(&mut self, name: S, address: Address) -> Result<(), LinkError>where
S: AsRef<str>,
Links a library into the current bytecode.
Panics
Panics if an invalid library name is used (for example if it is more than 38 characters long).
sourcepub fn to_bytes(&self) -> Result<Bytes, LinkError>
pub fn to_bytes(&self) -> Result<Bytes, LinkError>
Converts a bytecode into its byte representation.
sourcepub fn undefined_libraries(&self) -> LibIter<'_>ⓘNotable traits for LibIter<'a>impl<'a> Iterator for LibIter<'a> type Item = &'a str;
pub fn undefined_libraries(&self) -> LibIter<'_>ⓘNotable traits for LibIter<'a>impl<'a> Iterator for LibIter<'a> type Item = &'a str;
Returns an iterator over all libraries remaining in the bytecode.
sourcepub fn requires_linking(&self) -> bool
pub fn requires_linking(&self) -> bool
Returns true if bytecode requires linking.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Bytecode
impl<'de> Deserialize<'de> for Bytecode
sourcefn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Bytecode
impl Send for Bytecode
impl Sync for Bytecode
impl Unpin for Bytecode
impl UnwindSafe for Bytecode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more