Struct JsonRuntimeBinder

Source
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

Source§

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

Source§

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

Source§

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

Source§

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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.
Source§

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