pub struct ViewFunctionResult {
pub result: Vec<u8>,
pub logs: Vec<String>,
pub block_height: u64,
pub block_hash: CryptoHash,
}Expand description
View function result from call_function RPC.
Fields§
§result: Vec<u8>Result bytes (often JSON).
logs: Vec<String>Logs emitted during view call.
block_height: u64Block height of the query.
block_hash: CryptoHashBlock hash of the query.
Implementations§
Source§impl ViewFunctionResult
impl ViewFunctionResult
Sourcepub fn as_string(&self) -> Result<String, FromUtf8Error>
pub fn as_string(&self) -> Result<String, FromUtf8Error>
Get the result as a string.
Sourcepub fn json<T: DeserializeOwned>(&self) -> Result<T, Error>
pub fn json<T: DeserializeOwned>(&self) -> Result<T, Error>
Sourcepub fn borsh<T: BorshDeserialize>(&self) -> Result<T, Error>
pub fn borsh<T: BorshDeserialize>(&self) -> Result<T, Error>
Trait Implementations§
Source§impl Clone for ViewFunctionResult
impl Clone for ViewFunctionResult
Source§fn clone(&self) -> ViewFunctionResult
fn clone(&self) -> ViewFunctionResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ViewFunctionResult
impl Debug for ViewFunctionResult
Source§impl<'de> Deserialize<'de> for ViewFunctionResult
impl<'de> Deserialize<'de> for ViewFunctionResult
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
Auto Trait Implementations§
impl Freeze for ViewFunctionResult
impl RefUnwindSafe for ViewFunctionResult
impl Send for ViewFunctionResult
impl Sync for ViewFunctionResult
impl Unpin for ViewFunctionResult
impl UnsafeUnpin for ViewFunctionResult
impl UnwindSafe for ViewFunctionResult
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