pub enum ScriptValue {
Null,
Bool(bool),
Number(f64),
I64(i64),
U64(u64),
String(String),
Bytes(Vec<u8>),
List(Vec<ScriptValue>),
Object(BTreeMap<String, ScriptValue>),
}Expand description
Owned values at the native script boundary. Domain objects retain their
_type/unit/value or URI fields; adapters interpret them without losing units.
The tagged wire representation is only for process boundaries, not local calls.
Variants§
Null
Bool(bool)
Number(f64)
I64(i64)
U64(u64)
String(String)
Bytes(Vec<u8>)
List(Vec<ScriptValue>)
Object(BTreeMap<String, ScriptValue>)
Implementations§
Source§impl ScriptValue
impl ScriptValue
Sourcepub fn validate(&self, limits: ValueLimits) -> Result<(), ContractError>
pub fn validate(&self, limits: ValueLimits) -> Result<(), ContractError>
Enforce aggregate bounds before allocation in the JS engine. HTTP adapters must also bound the incoming body before deserializing it.
Trait Implementations§
Source§impl Clone for ScriptValue
impl Clone for ScriptValue
Source§impl Debug for ScriptValue
impl Debug for ScriptValue
Source§impl<'de> Deserialize<'de> for ScriptValue
impl<'de> Deserialize<'de> for ScriptValue
Source§fn 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
Source§impl PartialEq for ScriptValue
impl PartialEq for ScriptValue
Source§impl Serialize for ScriptValue
impl Serialize for ScriptValue
impl StructuralPartialEq for ScriptValue
Auto Trait Implementations§
impl Freeze for ScriptValue
impl RefUnwindSafe for ScriptValue
impl Send for ScriptValue
impl Sync for ScriptValue
impl Unpin for ScriptValue
impl UnsafeUnpin for ScriptValue
impl UnwindSafe for ScriptValue
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