pub struct JsonRuntimeBinder { /* private fields */ }
Expand description

A RuntimeBinder implementation which load runtime types mapping metadata from json.

Implementations§

source§

impl JsonRuntimeBinder

source

pub fn from_reader<R>(reader: R) -> Result<JsonRuntimeBinder, Error>where R: Read,

Create JsonRuntimeBinder from Reader

source

pub fn load<P>(path: P) -> Result<JsonRuntimeBinder, Error>where P: AsRef<Path>,

Try load JsonRuntimeBinder from json file with path parameter

Trait Implementations§

source§

impl Debug for JsonRuntimeBinder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for JsonRuntimeBinder

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<JsonRuntimeBinder, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl FromStr for JsonRuntimeBinder

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str( s: &str ) -> Result<JsonRuntimeBinder, <JsonRuntimeBinder as FromStr>::Err>

Parses a string s to return a value of this type. Read more
source§

impl RuntimeBinder for JsonRuntimeBinder

source§

fn to_runtime_type(&mut self, type: &Type) -> Result<Option<&str>, Error>

Convert contract abi type to runtime type string Read more
source§

fn get(&mut self, name: &str) -> Result<&str, Error>

Get runtime type by metadata name, If not found the implementation must return [Err(BindError::UnknownType)]
source§

impl Serialize for JsonRuntimeBinder

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&[u8]> for JsonRuntimeBinder

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from( value: &[u8] ) -> Result<JsonRuntimeBinder, <JsonRuntimeBinder as TryFrom<&[u8]>>::Error>

Performs the conversion.
source§

impl TryFrom<&str> for JsonRuntimeBinder

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from( value: &str ) -> Result<JsonRuntimeBinder, <JsonRuntimeBinder as TryFrom<&str>>::Error>

Performs the conversion.
source§

impl TryFrom<String> for JsonRuntimeBinder

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from( value: String ) -> Result<JsonRuntimeBinder, <JsonRuntimeBinder as TryFrom<String>>::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,