pub struct Bytecode(/* private fields */);
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§
Source§impl 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>
pub fn link<S>(&mut self, name: S, address: Address) -> Result<(), LinkError>
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<'_> ⓘ
pub fn undefined_libraries(&self) -> LibIter<'_> ⓘ
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§
Source§impl<'de> Deserialize<'de> for Bytecode
impl<'de> Deserialize<'de> for Bytecode
Source§fn 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 Freeze for Bytecode
impl RefUnwindSafe for Bytecode
impl Send for Bytecode
impl Sync for Bytecode
impl Unpin for Bytecode
impl UnwindSafe for Bytecode
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