Skip to main content

Compilation

Struct Compilation 

Source
pub struct Compilation { /* private fields */ }

Implementations§

Source§

impl Compilation

Source

pub fn contract(&self) -> &Contract

Source

pub fn source_info(&self) -> Option<&SourceInfo>

Source

pub fn into_parts(self) -> (Contract, Option<SourceInfo>)

Source

pub fn try_from_raw( raw_contract: RawContract, raw_source_info: Option<SerializedSourceInfo>, limits: &Limits, ) -> Result<Self, ContractValidationError>

Source

pub fn try_from_raw_with_context( raw_contract: RawContract, raw_source_info: Option<SerializedSourceInfo>, context: &RuntimeContext, ) -> Result<Self, ContractValidationError>

Source

pub fn from_json_with_limits( input: &str, limits: &Limits, ) -> Result<Self, ContractJsonError>

Parse, validate, and canonicalize a Compilation JSON document under caller-supplied limits.

max_input_bytes is enforced before the document is decoded, so an oversized sidecar is rejected without being materialized.

Source

pub fn from_json_with_context( input: &str, context: &RuntimeContext, ) -> Result<Self, ContractJsonError>

Bounded parse: the byte gate, decode, and validation share one budget.

Source

pub fn from_slice_with_limits( input: &[u8], limits: &Limits, ) -> Result<Self, ContractJsonError>

Bounded parse from bytes.

Source

pub fn from_slice_with_context( input: &[u8], context: &RuntimeContext, ) -> Result<Self, ContractJsonError>

Source

pub fn to_json_pretty_with_limits( &self, limits: &Limits, ) -> Result<String, ContractValidationError>

Serialize validated canonical JSON under caller-supplied limits.

Like Contract::to_json_pretty_with_limits, this revalidates and charges the rendered length against max_canonicalization_work, so it may require raising that limit in addition to whichever structural limit gated construction.

Source

pub fn to_json_pretty_with_context( &self, context: &RuntimeContext, ) -> Result<String, ContractValidationError>

Trait Implementations§

Source§

impl Clone for Compilation

Source§

fn clone(&self) -> Compilation

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Compilation

Source§

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

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

impl Eq for Compilation

Source§

impl PartialEq for Compilation

Source§

fn eq(&self, other: &Compilation) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Compilation

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

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

impl StructuralPartialEq for Compilation

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.