pub enum Post {
Info(Json),
Action(Json),
}Expand description
What a post carries: an info read, as it would be posted to /info, or a signed action, the
whole /exchange body. Either is kept as written, key order and digits, since an action’s
signature is over exactly what was built.
Variants§
Implementations§
Source§impl Post
impl Post
Sourcepub fn info(request: &str) -> Result<Post, BadJson>
pub fn info(request: &str) -> Result<Post, BadJson>
An info read, the body /info would take: {"type":"l2Book","coin":"ETH"}.
Sourcepub fn action(body: &str) -> Result<Post, BadJson>
pub fn action(body: &str) -> Result<Post, BadJson>
A signed action, the body /exchange would take: {"action":..,"nonce":.., "signature":..,"vaultAddress":..}. Like /exchange, never sent twice: a post that
goes unanswered may still have landed.
pub const fn payload(&self) -> &Json
Trait Implementations§
impl Eq for Post
impl StructuralPartialEq for Post
Auto Trait Implementations§
impl Freeze for Post
impl RefUnwindSafe for Post
impl Send for Post
impl Sync for Post
impl Unpin for Post
impl UnsafeUnpin for Post
impl UnwindSafe for Post
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.