pub struct Feed {
pub feed_id: ID,
}
Expand description
Represents a feed that identifies the report stream ID.
The Feed
struct contains a feed_id
field, which is an ID
representing
the unique identifier of the feed.
§Examples
use chainlink_data_streams_sdk::feed::Feed;
use chainlink_data_streams_report::feed_id::ID;
let id = ID::from_hex_str("0x00016b4aa7e57ca7b68ae1bf45653f56b656fd3aa335ef7fae696b663f1b8472").unwrap();
let feed = Feed { feed_id: id };
Fields§
§feed_id: ID
The unique identifier of the feed.
Implementations§
Source§impl Feed
impl Feed
Sourcepub fn version(&self) -> FeedVersion
pub fn version(&self) -> FeedVersion
Returns the feed version extracted from the first two bytes of the ID
.
§Returns
A FeedVersion
representing the version number.
§Examples
use chainlink_data_streams_report::feed_id::ID;
use chainlink_data_streams_sdk::feed::{Feed, FeedVersion};
let feed_id = ID::from_hex_str("0x00016b4aa7e57ca7b68ae1bf45653f56b656fd3aa335ef7fae696b663f1b8472").unwrap();
let feed = Feed { feed_id };
let version = feed.version();
assert_eq!(version, FeedVersion(1));
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Feed
impl<'de> Deserialize<'de> for Feed
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
impl Eq for Feed
impl StructuralPartialEq for Feed
Auto Trait Implementations§
impl Freeze for Feed
impl RefUnwindSafe for Feed
impl Send for Feed
impl Sync for Feed
impl Unpin for Feed
impl UnwindSafe for Feed
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.