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>
sourcepub fn find_error_type(
&self,
value: u32
) -> Result<&ScSpecUdtErrorEnumCaseV0, Error>
pub fn find_error_type( &self, value: u32 ) -> Result<&ScSpecUdtErrorEnumCaseV0, Error>
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 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