pub struct ScriptReader;
Expand description
A utility struct for reading and interpreting Neo smart contract scripts.
Implementations§
Source§impl ScriptReader
impl ScriptReader
Sourcepub fn get_interop_service_code(_hash: String) -> Option<InteropService>
pub fn get_interop_service_code(_hash: String) -> Option<InteropService>
Retrieves the InteropService code from a given hash.
§Arguments
_hash
- A string representation of the hash.
§Returns
An Option containing the InteropService if found, or None if not found.
§Example
use neo3::neo_builder::ScriptReader;
let hash = "9bf667ce".to_string();
if let Some(_service) = ScriptReader::get_interop_service_code(hash) {
println!("InteropService found");
} else {
println!("InteropService not found");
}
Sourcepub fn convert_to_op_code_string(script: &Bytes) -> String
pub fn convert_to_op_code_string(script: &Bytes) -> String
Converts a byte script to a human-readable string of OpCodes.
§Arguments
script
- The byte script to convert.
§Returns
A string representation of the OpCodes in the script.
§Example
use neo3::neo_builder::ScriptReader;
let script = hex::decode("0c0548656c6c6f").unwrap();
let op_code_string = ScriptReader::convert_to_op_code_string(&script);
println!("OpCodes: {}", op_code_string);
// Output: OpCodes: PUSHDATA1 5 48656c6c6f
Auto Trait Implementations§
impl Freeze for ScriptReader
impl RefUnwindSafe for ScriptReader
impl Send for ScriptReader
impl Sync for ScriptReader
impl Unpin for ScriptReader
impl UnwindSafe for ScriptReader
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more