Enum sway_types::Context
source · [−]pub enum Context {
CallFrame(CallFrame),
TransactionScript(TransactionScript),
}
Variants
CallFrame(CallFrame)
TransactionScript(TransactionScript)
Implementations
sourceimpl Context
impl Context
pub fn validate_source<P>(path: P) -> Result<()> where
P: AsRef<Path>,
pub fn validate_range<'a>(range: impl Iterator<Item = &'a Range>) -> Result<()>
pub fn id_from_repr<'a>(bytes: impl Iterator<Item = &'a u8>) -> Id
pub const fn id(&self) -> &Id
pub const fn source(&self) -> &Source
pub const fn range(&self) -> &Range
pub fn program(&self) -> &[Instruction]
pub fn contract(&self) -> Option<ContractId>
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Context
impl<'de> Deserialize<'de> for Context
sourcefn 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
sourceimpl From<TransactionScript> for Context
impl From<TransactionScript> for Context
sourcefn from(script: TransactionScript) -> Self
fn from(script: TransactionScript) -> Self
Performs the conversion.
impl Eq for Context
impl StructuralEq for Context
impl StructuralPartialEq for Context
Auto Trait Implementations
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more