Struct soroban_spec_tools::Spec
source · pub struct Spec(pub Option<Vec<ScSpecEntry>>);Tuple Fields§
§0: Option<Vec<ScSpecEntry>>Implementations§
source§impl Spec
impl Spec
sourcepub fn doc(
&self,
name: &str,
type_: &ScType,
) -> Result<Option<&'static str>, Error>
pub fn doc( &self, name: &str, type_: &ScType, ) -> Result<Option<&'static str>, Error>
§Errors
Could fail to find User Defined Type
sourcepub fn find_function(&self, name: &str) -> Result<&ScSpecFunctionV0, Error>
pub fn find_function(&self, name: &str) -> Result<&ScSpecFunctionV0, Error>
§Errors
Might return errors
sourcepub fn find_functions(
&self,
) -> Result<impl Iterator<Item = &ScSpecFunctionV0>, Error>
pub fn find_functions( &self, ) -> Result<impl Iterator<Item = &ScSpecFunctionV0>, Error>
§Errors
sourcepub fn find_error_type(
&self,
value: u32,
) -> Result<&ScSpecUdtErrorEnumCaseV0, Error>
pub fn find_error_type( &self, value: u32, ) -> Result<&ScSpecUdtErrorEnumCaseV0, Error>
§Errors
sourcepub fn from_string_primitive(s: &str, t: &ScType) -> Result<ScVal, Error>
pub fn from_string_primitive(s: &str, t: &ScType) -> Result<ScVal, Error>
§Errors
Might return errors
source§impl Spec
impl Spec
sourcepub fn vec_m_to_json<const MAX: u32>(
&self,
vec_m: &VecM<ScVal, MAX>,
type_: &ScType,
) -> Result<Value, Error>
pub fn vec_m_to_json<const MAX: u32>( &self, vec_m: &VecM<ScVal, MAX>, type_: &ScType, ) -> Result<Value, Error>
§Errors
Might return an error
sourcepub fn sc_map_to_json(
&self,
sc_map: &ScMap,
type_: &ScSpecTypeMap,
) -> Result<Value, Error>
pub fn sc_map_to_json( &self, sc_map: &ScMap, type_: &ScSpecTypeMap, ) -> Result<Value, Error>
§Errors
Might return an error
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Spec
impl RefUnwindSafe for Spec
impl Send for Spec
impl Sync for Spec
impl Unpin for Spec
impl UnwindSafe for Spec
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T, U, V, W, E, C> Compare<(T, U, V, W)> for C
impl<T, U, V, W, E, C> Compare<(T, U, V, W)> for C
type Error = E
fn compare( &self, a: &(T, U, V, W), b: &(T, U, V, W), ) -> Result<Ordering, <C as Compare<(T, U, V, W)>>::Error>
source§impl<T, U, V, W, X, E, C> Compare<(T, U, V, W, X)> for C
impl<T, U, V, W, X, E, C> Compare<(T, U, V, W, X)> for C
type Error = E
fn compare( &self, a: &(T, U, V, W, X), b: &(T, U, V, W, X), ) -> Result<Ordering, <C as Compare<(T, U, V, W, X)>>::Error>
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more