Enum pythnet_sdk::messages::Message
source · pub enum Message {
PriceFeedMessage(PriceFeedMessage),
TwapMessage(TwapMessage),
PublisherStakeCapsMessage(PublisherStakeCapsMessage),
}
Expand description
Message format for sending data to other chains via the accumulator program When serialized with PythNet serialization format, each message starts with a unique 1-byte discriminator, followed by the serialized struct data in the definition(s) below.
Messages are forward-compatible. You may add new fields to messages after all previously defined fields. All code for parsing messages must ignore any extraneous bytes at the end of the message (which could be fields that the code does not yet understand).
The oracle is not using the Message enum due to the contract size limit and some of the methods for PriceFeedMessage and TwapMessage are not used by the oracle for the same reason. Rust compiler doesn’t include the unused methods in the contract. Once we start using the unused structs and methods, the contract size will increase.
Variants§
PriceFeedMessage(PriceFeedMessage)
TwapMessage(TwapMessage)
PublisherStakeCapsMessage(PublisherStakeCapsMessage)
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
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>,
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)