pub struct Subscribe<'a> {
pub common_fields: CommonFields<'a>,
pub accounts: Option<Vec<Cow<'a, str>>>,
pub accounts_proposed: Option<Vec<Cow<'a, str>>>,
pub books: Option<Vec<SubscribeBook<'a>>>,
pub streams: Option<Vec<StreamParameter>>,
pub url: Option<Cow<'a, str>>,
pub url_password: Option<Cow<'a, str>>,
pub url_username: Option<Cow<'a, str>>,
}
Expand description
The subscribe method requests periodic notifications from the server when certain events happen.
Note: WebSocket API only.
See Subscribe:
<https://xrpl.org/subscribe.html>
Fields§
§common_fields: CommonFields<'a>
The common fields shared by all requests.
accounts: Option<Vec<Cow<'a, str>>>
Array with the unique addresses of accounts to monitor for validated transactions. The addresses must be in the XRP Ledger’s base58 format. The server sends a notification for any transaction that affects at least one of these accounts.
accounts_proposed: Option<Vec<Cow<'a, str>>>
Like accounts, but include transactions that are not yet finalized.
books: Option<Vec<SubscribeBook<'a>>>
Array of objects defining order books to monitor for updates, as detailed below.
streams: Option<Vec<StreamParameter>>
Array of string names of generic streams to subscribe to.
url: Option<Cow<'a, str>>
(Optional for Websocket; Required otherwise) URL where the server sends a JSON-RPC callbacks for each event. Admin-only.
url_password: Option<Cow<'a, str>>
Password to provide for basic authentication at the callback URL.
url_username: Option<Cow<'a, str>>
Username to provide for basic authentication at the callback URL.
Implementations§
Source§impl<'a> Subscribe<'a>
impl<'a> Subscribe<'a>
pub fn new( id: Option<Cow<'a, str>>, accounts: Option<Vec<Cow<'a, str>>>, accounts_proposed: Option<Vec<Cow<'a, str>>>, books: Option<Vec<SubscribeBook<'a>>>, streams: Option<Vec<StreamParameter>>, url: Option<Cow<'a, str>>, url_password: Option<Cow<'a, str>>, url_username: Option<Cow<'a, str>>, ) -> Self
Trait Implementations§
Source§impl<'de, 'a> Deserialize<'de> for Subscribe<'a>
impl<'de, 'a> Deserialize<'de> for Subscribe<'a>
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>,
Source§impl<'a> From<Subscribe<'a>> for XRPLRequest<'a>
impl<'a> From<Subscribe<'a>> for XRPLRequest<'a>
Source§impl<'a> Model for Subscribe<'a>
impl<'a> Model for Subscribe<'a>
Source§fn get_errors(&self) -> XRPLModelResult<()>
fn get_errors(&self) -> XRPLModelResult<()>
Source§fn validate(&self) -> XRPLModelResult<()>
fn validate(&self) -> XRPLModelResult<()>
get_errors
if there was one.Source§impl<'a> Request<'a> for Subscribe<'a>
impl<'a> Request<'a> for Subscribe<'a>
fn get_common_fields(&self) -> &CommonFields<'a>
fn get_common_fields_mut(&mut self) -> &mut CommonFields<'a>
impl<'a> Eq for Subscribe<'a>
impl<'a> StructuralPartialEq for Subscribe<'a>
Auto Trait Implementations§
impl<'a> Freeze for Subscribe<'a>
impl<'a> RefUnwindSafe for Subscribe<'a>
impl<'a> Send for Subscribe<'a>
impl<'a> Sync for Subscribe<'a>
impl<'a> Unpin for Subscribe<'a>
impl<'a> UnwindSafe for Subscribe<'a>
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§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
key
and return true
if they are equal.