Struct near_sdk_sim::ViewResult [−][src]
pub struct ViewResult { /* fields omitted */ }
The result of a view call. Contains the logs made during the view method call and Result value, which can be unwrapped and deserialized.
Implementations
impl ViewResult
[src]
impl ViewResult
[src]pub fn new(result: Result<Vec<u8>, Box<dyn Error>>, logs: Vec<String>) -> Self
[src]
pub fn logs(&self) -> &Vec<String>
[src]
Logs made during the view call
pub fn is_err(&self) -> bool
[src]
pub fn is_ok(&self) -> bool
[src]
pub fn unwrap(&self) -> Vec<u8>
[src]
Attempt unwrap the value returned by the view call and panic if it is an error
pub fn unwrap_err(&self) -> &dyn Error
[src]
pub fn unwrap_json_value(&self) -> Value
[src]
Interpret the value as a JSON::Value
pub fn unwrap_borsh<T: BorshDeserialize>(&self) -> T
[src]
Deserialize the value with Borsh
pub fn unwrap_json<T: DeserializeOwned>(&self) -> T
[src]
Deserialize the value with JSON
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for ViewResult
impl !RefUnwindSafe for ViewResult
impl !Send for ViewResult
impl !Send for ViewResult
impl !Sync for ViewResult
impl !Sync for ViewResult
impl Unpin for ViewResult
impl Unpin for ViewResult
impl !UnwindSafe for ViewResult
impl !UnwindSafe for ViewResult
Blanket Implementations
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,