pub struct OracleUpdate { /* private fields */ }Expand description
Oracle update structure
Implementations§
Source§impl OracleUpdate
impl OracleUpdate
pub fn new(data: Vec<u8>, validator: AuthorityKeyBytes) -> Self
Sourcepub fn data(&self) -> &[u8] ⓘ
pub fn data(&self) -> &[u8] ⓘ
Returns the Oracle data as a Base64 encoded string
§Returns
The output that resulted from the Oracle Duty being performed, serialized as bytes with Borsh
Sourcepub fn validator(&self) -> AuthorityKeyBytes
pub fn validator(&self) -> AuthorityKeyBytes
The 96-byte BLS12-381 authority public key of the validator.
Sourcepub fn try_data_as_output(&self) -> Result<OracleOutput, OracleProcessorError>
pub fn try_data_as_output(&self) -> Result<OracleOutput, OracleProcessorError>
Returns the data as OracleOutput
§Returns
The output that resulted from the Oracle Duty being performed, deserialized as OracleOutput
Sourcepub fn success_payload(&self) -> Option<OracleData>
pub fn success_payload(&self) -> Option<OracleData>
Returns the OracleData payload returned by the oracle if the request was a success.
Otherwise, returns None.
§Returns
An Option containing the OracleData payload if the oracle output was a success, or None otherwise.
pub fn get_oracle_response_timestamp(&self) -> Option<String>
Trait Implementations§
Source§impl Clone for OracleUpdate
impl Clone for OracleUpdate
Source§fn clone(&self) -> OracleUpdate
fn clone(&self) -> OracleUpdate
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 OracleUpdate
impl Debug for OracleUpdate
Source§impl<'de> Deserialize<'de> for OracleUpdate
impl<'de> Deserialize<'de> for OracleUpdate
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 HumanReadable for OracleUpdate
impl HumanReadable for OracleUpdate
Source§fn human_readable(&self) -> String
fn human_readable(&self) -> String
Return a human-readable string representation
Source§impl PartialEq for OracleUpdate
impl PartialEq for OracleUpdate
Source§impl Serialize for OracleUpdate
impl Serialize for OracleUpdate
impl Representable for OracleUpdate
impl StructuralPartialEq for OracleUpdate
Auto Trait Implementations§
impl Freeze for OracleUpdate
impl RefUnwindSafe for OracleUpdate
impl Send for OracleUpdate
impl Sync for OracleUpdate
impl Unpin for OracleUpdate
impl UnwindSafe for OracleUpdate
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