Skip to main content

HyperliquidConnector

Struct HyperliquidConnector 

Source
pub struct HyperliquidConnector { /* private fields */ }
Expand description

Hyperliquid DEX connector

Implementations§

Source§

impl HyperliquidConnector

Source

pub async fn new( credentials: Option<Credentials>, is_testnet: bool, ) -> ExchangeResult<Self>

Create new connector

§Arguments
  • credentials - Wallet credentials (private key in api_secret, address in api_key)
  • is_testnet - Use testnet if true
Source

pub async fn public(is_testnet: bool) -> ExchangeResult<Self>

Create public connector (no authentication, market data only)

Examples found in repository?
examples/e2e_metadata.rs (line 311)
307async fn test_hyperliquid_rest() -> RestTally {
308    println!("\n── Hyperliquid REST ─────────────────────────────────────────");
309    let mut tally = RestTally { exchange: "Hyperliquid".into(), tested: 0, passed: 0, failed: 0 };
310
311    let conn = match HyperliquidConnector::public(false).await {
312        Ok(c) => c,
313        Err(e) => {
314            println!("  FAIL: connector init -> {}", e);
315            tally.failed += 1;
316            tally.tested += 1;
317            return tally;
318        }
319    };
320
321    // get_meta_and_asset_ctxs
322    tally.tested += 1;
323    match conn.get_meta_and_asset_ctxs().await {
324        Ok(v) => {
325            let summary = if v.is_array() {
326                format!("[{} elements]", v.as_array().map(|a| a.len()).unwrap_or(0))
327            } else {
328                abbrev(&v)
329            };
330            println!("  OK:   get_meta_and_asset_ctxs -> {}", summary);
331            tally.passed += 1;
332        }
333        Err(e) => { fail_rest!("get_meta_and_asset_ctxs", e); tally.failed += 1; }
334    }
335
336    // get_predicted_fundings
337    tally.tested += 1;
338    match conn.get_predicted_fundings().await {
339        Ok(v) => {
340            let summary = if v.is_array() {
341                format!("[{} entries]", v.as_array().map(|a| a.len()).unwrap_or(0))
342            } else {
343                abbrev(&v)
344            };
345            println!("  OK:   get_predicted_fundings -> {}", summary);
346            tally.passed += 1;
347        }
348        Err(e) => { fail_rest!("get_predicted_fundings", e); tally.failed += 1; }
349    }
350
351    // NEW: get_spot_meta_and_asset_ctxs
352    tally.tested += 1;
353    match conn.get_spot_meta_and_asset_ctxs().await {
354        Ok(v) => {
355            let summary = if v.is_array() {
356                format!("[{} elements]", v.as_array().map(|a| a.len()).unwrap_or(0))
357            } else {
358                abbrev(&v)
359            };
360            println!("  OK:   get_spot_meta_and_asset_ctxs -> {}", summary);
361            tally.passed += 1;
362        }
363        Err(e) => { fail_rest!("get_spot_meta_and_asset_ctxs", e); tally.failed += 1; }
364    }
365
366    // NEW: get_non_funding_ledger_updates (zero address — expect empty array)
367    tally.tested += 1;
368    let now_ms = std::time::SystemTime::now()
369        .duration_since(std::time::UNIX_EPOCH)
370        .map(|d| d.as_millis() as i64)
371        .unwrap_or(0);
372    match conn.get_non_funding_ledger_updates(
373        "0x0000000000000000000000000000000000000000",
374        0,
375        Some(now_ms),
376    ).await {
377        Ok(v) => {
378            let summary = if v.is_array() {
379                format!("[{} entries]", v.as_array().map(|a| a.len()).unwrap_or(0))
380            } else {
381                abbrev(&v)
382            };
383            println!("  OK:   get_non_funding_ledger_updates(zero_addr) -> {}", summary);
384            tally.passed += 1;
385        }
386        Err(e) => { fail_rest!("get_non_funding_ledger_updates", e); tally.failed += 1; }
387    }
388
389    // NEW: get_vault_details (HLP vault)
390    tally.tested += 1;
391    match conn.get_vault_details("0xa15099a30bbf2e68942d6f4c43d70d04faeab0a0").await {
392        Ok(v) => {
393            let summary = if v.is_null() { "null (unknown vault)".to_string() } else { abbrev(&v) };
394            println!("  OK:   get_vault_details(HLP) -> {}", summary);
395            tally.passed += 1;
396        }
397        Err(e) => { fail_rest!("get_vault_details", e); tally.failed += 1; }
398    }
399
400    tally
401}
Source

pub async fn get_metadata(&self) -> ExchangeResult<Value>

Get perpetuals metadata (asset index mapping)

Source

pub async fn get_spot_metadata(&self) -> ExchangeResult<Value>

Get spot metadata

Source

pub async fn get_all_mids(&self) -> ExchangeResult<Value>

Get all mid prices

Source

pub async fn get_meta_and_asset_ctxs(&self) -> ExchangeResult<Value>

Get perpetuals metadata combined with all asset contexts in one call.

POSTs {"type":"metaAndAssetCtxs"} to the /info endpoint. Returns the raw JSON response which is a two-element array: [meta_object, array_of_asset_ctx_objects].

Useful for bootstrapping: get the full universe + current mark/index prices

  • funding rates + OI in a single round-trip instead of two separate calls.
Examples found in repository?
examples/e2e_metadata.rs (line 323)
307async fn test_hyperliquid_rest() -> RestTally {
308    println!("\n── Hyperliquid REST ─────────────────────────────────────────");
309    let mut tally = RestTally { exchange: "Hyperliquid".into(), tested: 0, passed: 0, failed: 0 };
310
311    let conn = match HyperliquidConnector::public(false).await {
312        Ok(c) => c,
313        Err(e) => {
314            println!("  FAIL: connector init -> {}", e);
315            tally.failed += 1;
316            tally.tested += 1;
317            return tally;
318        }
319    };
320
321    // get_meta_and_asset_ctxs
322    tally.tested += 1;
323    match conn.get_meta_and_asset_ctxs().await {
324        Ok(v) => {
325            let summary = if v.is_array() {
326                format!("[{} elements]", v.as_array().map(|a| a.len()).unwrap_or(0))
327            } else {
328                abbrev(&v)
329            };
330            println!("  OK:   get_meta_and_asset_ctxs -> {}", summary);
331            tally.passed += 1;
332        }
333        Err(e) => { fail_rest!("get_meta_and_asset_ctxs", e); tally.failed += 1; }
334    }
335
336    // get_predicted_fundings
337    tally.tested += 1;
338    match conn.get_predicted_fundings().await {
339        Ok(v) => {
340            let summary = if v.is_array() {
341                format!("[{} entries]", v.as_array().map(|a| a.len()).unwrap_or(0))
342            } else {
343                abbrev(&v)
344            };
345            println!("  OK:   get_predicted_fundings -> {}", summary);
346            tally.passed += 1;
347        }
348        Err(e) => { fail_rest!("get_predicted_fundings", e); tally.failed += 1; }
349    }
350
351    // NEW: get_spot_meta_and_asset_ctxs
352    tally.tested += 1;
353    match conn.get_spot_meta_and_asset_ctxs().await {
354        Ok(v) => {
355            let summary = if v.is_array() {
356                format!("[{} elements]", v.as_array().map(|a| a.len()).unwrap_or(0))
357            } else {
358                abbrev(&v)
359            };
360            println!("  OK:   get_spot_meta_and_asset_ctxs -> {}", summary);
361            tally.passed += 1;
362        }
363        Err(e) => { fail_rest!("get_spot_meta_and_asset_ctxs", e); tally.failed += 1; }
364    }
365
366    // NEW: get_non_funding_ledger_updates (zero address — expect empty array)
367    tally.tested += 1;
368    let now_ms = std::time::SystemTime::now()
369        .duration_since(std::time::UNIX_EPOCH)
370        .map(|d| d.as_millis() as i64)
371        .unwrap_or(0);
372    match conn.get_non_funding_ledger_updates(
373        "0x0000000000000000000000000000000000000000",
374        0,
375        Some(now_ms),
376    ).await {
377        Ok(v) => {
378            let summary = if v.is_array() {
379                format!("[{} entries]", v.as_array().map(|a| a.len()).unwrap_or(0))
380            } else {
381                abbrev(&v)
382            };
383            println!("  OK:   get_non_funding_ledger_updates(zero_addr) -> {}", summary);
384            tally.passed += 1;
385        }
386        Err(e) => { fail_rest!("get_non_funding_ledger_updates", e); tally.failed += 1; }
387    }
388
389    // NEW: get_vault_details (HLP vault)
390    tally.tested += 1;
391    match conn.get_vault_details("0xa15099a30bbf2e68942d6f4c43d70d04faeab0a0").await {
392        Ok(v) => {
393            let summary = if v.is_null() { "null (unknown vault)".to_string() } else { abbrev(&v) };
394            println!("  OK:   get_vault_details(HLP) -> {}", summary);
395            tally.passed += 1;
396        }
397        Err(e) => { fail_rest!("get_vault_details", e); tally.failed += 1; }
398    }
399
400    tally
401}
Source

pub async fn get_clearinghouse_state(&self, user: &str) -> ExchangeResult<Value>

Get the clearinghouse state for a user address.

POSTs {"type":"clearinghouseState","user":"<address>"} to /info. Returns account value, margin summary, and all open positions. No cryptographic signature required — only the wallet address.

Source§

impl HyperliquidConnector

Source

pub async fn batch_amend_orders( &self, modifies: Vec<(String, f64, f64, String)>, ) -> ExchangeResult<Value>

Batch modify (amend) multiple existing orders via the batchModify action on /exchange.

Each entry in modifies is (order_id_str, new_price, new_size, asset_symbol). All four fields are required per Hyperliquid’s batchModify spec.

Max 10 modifies per batch.

Returns the raw JSON exchange response.

Source§

impl HyperliquidConnector

Source

pub async fn get_predicted_fundings(&self) -> ExchangeResult<Value>

Get predicted (next-epoch) funding rates for all perpetual assets.

POSTs {"type": "predictedFundings"} to the info endpoint. Returns the raw JSON value — callers can parse the array of [coin, [[venue, predicted_rate], ...]] entries as needed.

Examples found in repository?
examples/e2e_metadata.rs (line 338)
307async fn test_hyperliquid_rest() -> RestTally {
308    println!("\n── Hyperliquid REST ─────────────────────────────────────────");
309    let mut tally = RestTally { exchange: "Hyperliquid".into(), tested: 0, passed: 0, failed: 0 };
310
311    let conn = match HyperliquidConnector::public(false).await {
312        Ok(c) => c,
313        Err(e) => {
314            println!("  FAIL: connector init -> {}", e);
315            tally.failed += 1;
316            tally.tested += 1;
317            return tally;
318        }
319    };
320
321    // get_meta_and_asset_ctxs
322    tally.tested += 1;
323    match conn.get_meta_and_asset_ctxs().await {
324        Ok(v) => {
325            let summary = if v.is_array() {
326                format!("[{} elements]", v.as_array().map(|a| a.len()).unwrap_or(0))
327            } else {
328                abbrev(&v)
329            };
330            println!("  OK:   get_meta_and_asset_ctxs -> {}", summary);
331            tally.passed += 1;
332        }
333        Err(e) => { fail_rest!("get_meta_and_asset_ctxs", e); tally.failed += 1; }
334    }
335
336    // get_predicted_fundings
337    tally.tested += 1;
338    match conn.get_predicted_fundings().await {
339        Ok(v) => {
340            let summary = if v.is_array() {
341                format!("[{} entries]", v.as_array().map(|a| a.len()).unwrap_or(0))
342            } else {
343                abbrev(&v)
344            };
345            println!("  OK:   get_predicted_fundings -> {}", summary);
346            tally.passed += 1;
347        }
348        Err(e) => { fail_rest!("get_predicted_fundings", e); tally.failed += 1; }
349    }
350
351    // NEW: get_spot_meta_and_asset_ctxs
352    tally.tested += 1;
353    match conn.get_spot_meta_and_asset_ctxs().await {
354        Ok(v) => {
355            let summary = if v.is_array() {
356                format!("[{} elements]", v.as_array().map(|a| a.len()).unwrap_or(0))
357            } else {
358                abbrev(&v)
359            };
360            println!("  OK:   get_spot_meta_and_asset_ctxs -> {}", summary);
361            tally.passed += 1;
362        }
363        Err(e) => { fail_rest!("get_spot_meta_and_asset_ctxs", e); tally.failed += 1; }
364    }
365
366    // NEW: get_non_funding_ledger_updates (zero address — expect empty array)
367    tally.tested += 1;
368    let now_ms = std::time::SystemTime::now()
369        .duration_since(std::time::UNIX_EPOCH)
370        .map(|d| d.as_millis() as i64)
371        .unwrap_or(0);
372    match conn.get_non_funding_ledger_updates(
373        "0x0000000000000000000000000000000000000000",
374        0,
375        Some(now_ms),
376    ).await {
377        Ok(v) => {
378            let summary = if v.is_array() {
379                format!("[{} entries]", v.as_array().map(|a| a.len()).unwrap_or(0))
380            } else {
381                abbrev(&v)
382            };
383            println!("  OK:   get_non_funding_ledger_updates(zero_addr) -> {}", summary);
384            tally.passed += 1;
385        }
386        Err(e) => { fail_rest!("get_non_funding_ledger_updates", e); tally.failed += 1; }
387    }
388
389    // NEW: get_vault_details (HLP vault)
390    tally.tested += 1;
391    match conn.get_vault_details("0xa15099a30bbf2e68942d6f4c43d70d04faeab0a0").await {
392        Ok(v) => {
393            let summary = if v.is_null() { "null (unknown vault)".to_string() } else { abbrev(&v) };
394            println!("  OK:   get_vault_details(HLP) -> {}", summary);
395            tally.passed += 1;
396        }
397        Err(e) => { fail_rest!("get_vault_details", e); tally.failed += 1; }
398    }
399
400    tally
401}
Source

pub async fn get_vault_details( &self, vault_address: &str, ) -> ExchangeResult<Value>

Get vault details for a vault address.

POSTs {"type":"vaultDetails","vaultAddress":"<addr>"} to /info. Returns null for unknown vaults, or a JSON object with vault state. No authentication required.

Examples found in repository?
examples/e2e_metadata.rs (line 391)
307async fn test_hyperliquid_rest() -> RestTally {
308    println!("\n── Hyperliquid REST ─────────────────────────────────────────");
309    let mut tally = RestTally { exchange: "Hyperliquid".into(), tested: 0, passed: 0, failed: 0 };
310
311    let conn = match HyperliquidConnector::public(false).await {
312        Ok(c) => c,
313        Err(e) => {
314            println!("  FAIL: connector init -> {}", e);
315            tally.failed += 1;
316            tally.tested += 1;
317            return tally;
318        }
319    };
320
321    // get_meta_and_asset_ctxs
322    tally.tested += 1;
323    match conn.get_meta_and_asset_ctxs().await {
324        Ok(v) => {
325            let summary = if v.is_array() {
326                format!("[{} elements]", v.as_array().map(|a| a.len()).unwrap_or(0))
327            } else {
328                abbrev(&v)
329            };
330            println!("  OK:   get_meta_and_asset_ctxs -> {}", summary);
331            tally.passed += 1;
332        }
333        Err(e) => { fail_rest!("get_meta_and_asset_ctxs", e); tally.failed += 1; }
334    }
335
336    // get_predicted_fundings
337    tally.tested += 1;
338    match conn.get_predicted_fundings().await {
339        Ok(v) => {
340            let summary = if v.is_array() {
341                format!("[{} entries]", v.as_array().map(|a| a.len()).unwrap_or(0))
342            } else {
343                abbrev(&v)
344            };
345            println!("  OK:   get_predicted_fundings -> {}", summary);
346            tally.passed += 1;
347        }
348        Err(e) => { fail_rest!("get_predicted_fundings", e); tally.failed += 1; }
349    }
350
351    // NEW: get_spot_meta_and_asset_ctxs
352    tally.tested += 1;
353    match conn.get_spot_meta_and_asset_ctxs().await {
354        Ok(v) => {
355            let summary = if v.is_array() {
356                format!("[{} elements]", v.as_array().map(|a| a.len()).unwrap_or(0))
357            } else {
358                abbrev(&v)
359            };
360            println!("  OK:   get_spot_meta_and_asset_ctxs -> {}", summary);
361            tally.passed += 1;
362        }
363        Err(e) => { fail_rest!("get_spot_meta_and_asset_ctxs", e); tally.failed += 1; }
364    }
365
366    // NEW: get_non_funding_ledger_updates (zero address — expect empty array)
367    tally.tested += 1;
368    let now_ms = std::time::SystemTime::now()
369        .duration_since(std::time::UNIX_EPOCH)
370        .map(|d| d.as_millis() as i64)
371        .unwrap_or(0);
372    match conn.get_non_funding_ledger_updates(
373        "0x0000000000000000000000000000000000000000",
374        0,
375        Some(now_ms),
376    ).await {
377        Ok(v) => {
378            let summary = if v.is_array() {
379                format!("[{} entries]", v.as_array().map(|a| a.len()).unwrap_or(0))
380            } else {
381                abbrev(&v)
382            };
383            println!("  OK:   get_non_funding_ledger_updates(zero_addr) -> {}", summary);
384            tally.passed += 1;
385        }
386        Err(e) => { fail_rest!("get_non_funding_ledger_updates", e); tally.failed += 1; }
387    }
388
389    // NEW: get_vault_details (HLP vault)
390    tally.tested += 1;
391    match conn.get_vault_details("0xa15099a30bbf2e68942d6f4c43d70d04faeab0a0").await {
392        Ok(v) => {
393            let summary = if v.is_null() { "null (unknown vault)".to_string() } else { abbrev(&v) };
394            println!("  OK:   get_vault_details(HLP) -> {}", summary);
395            tally.passed += 1;
396        }
397        Err(e) => { fail_rest!("get_vault_details", e); tally.failed += 1; }
398    }
399
400    tally
401}
Source

pub async fn get_spot_meta_and_asset_ctxs(&self) -> ExchangeResult<Value>

Get spot metadata combined with all spot asset contexts in one call.

POSTs {"type":"spotMetaAndAssetCtxs"} to the /info endpoint. Returns a two-element array: [spot_meta_object, array_of_spot_asset_ctx_objects]. Shape mirrors metaAndAssetCtxs but for spot markets.

Examples found in repository?
examples/e2e_metadata.rs (line 353)
307async fn test_hyperliquid_rest() -> RestTally {
308    println!("\n── Hyperliquid REST ─────────────────────────────────────────");
309    let mut tally = RestTally { exchange: "Hyperliquid".into(), tested: 0, passed: 0, failed: 0 };
310
311    let conn = match HyperliquidConnector::public(false).await {
312        Ok(c) => c,
313        Err(e) => {
314            println!("  FAIL: connector init -> {}", e);
315            tally.failed += 1;
316            tally.tested += 1;
317            return tally;
318        }
319    };
320
321    // get_meta_and_asset_ctxs
322    tally.tested += 1;
323    match conn.get_meta_and_asset_ctxs().await {
324        Ok(v) => {
325            let summary = if v.is_array() {
326                format!("[{} elements]", v.as_array().map(|a| a.len()).unwrap_or(0))
327            } else {
328                abbrev(&v)
329            };
330            println!("  OK:   get_meta_and_asset_ctxs -> {}", summary);
331            tally.passed += 1;
332        }
333        Err(e) => { fail_rest!("get_meta_and_asset_ctxs", e); tally.failed += 1; }
334    }
335
336    // get_predicted_fundings
337    tally.tested += 1;
338    match conn.get_predicted_fundings().await {
339        Ok(v) => {
340            let summary = if v.is_array() {
341                format!("[{} entries]", v.as_array().map(|a| a.len()).unwrap_or(0))
342            } else {
343                abbrev(&v)
344            };
345            println!("  OK:   get_predicted_fundings -> {}", summary);
346            tally.passed += 1;
347        }
348        Err(e) => { fail_rest!("get_predicted_fundings", e); tally.failed += 1; }
349    }
350
351    // NEW: get_spot_meta_and_asset_ctxs
352    tally.tested += 1;
353    match conn.get_spot_meta_and_asset_ctxs().await {
354        Ok(v) => {
355            let summary = if v.is_array() {
356                format!("[{} elements]", v.as_array().map(|a| a.len()).unwrap_or(0))
357            } else {
358                abbrev(&v)
359            };
360            println!("  OK:   get_spot_meta_and_asset_ctxs -> {}", summary);
361            tally.passed += 1;
362        }
363        Err(e) => { fail_rest!("get_spot_meta_and_asset_ctxs", e); tally.failed += 1; }
364    }
365
366    // NEW: get_non_funding_ledger_updates (zero address — expect empty array)
367    tally.tested += 1;
368    let now_ms = std::time::SystemTime::now()
369        .duration_since(std::time::UNIX_EPOCH)
370        .map(|d| d.as_millis() as i64)
371        .unwrap_or(0);
372    match conn.get_non_funding_ledger_updates(
373        "0x0000000000000000000000000000000000000000",
374        0,
375        Some(now_ms),
376    ).await {
377        Ok(v) => {
378            let summary = if v.is_array() {
379                format!("[{} entries]", v.as_array().map(|a| a.len()).unwrap_or(0))
380            } else {
381                abbrev(&v)
382            };
383            println!("  OK:   get_non_funding_ledger_updates(zero_addr) -> {}", summary);
384            tally.passed += 1;
385        }
386        Err(e) => { fail_rest!("get_non_funding_ledger_updates", e); tally.failed += 1; }
387    }
388
389    // NEW: get_vault_details (HLP vault)
390    tally.tested += 1;
391    match conn.get_vault_details("0xa15099a30bbf2e68942d6f4c43d70d04faeab0a0").await {
392        Ok(v) => {
393            let summary = if v.is_null() { "null (unknown vault)".to_string() } else { abbrev(&v) };
394            println!("  OK:   get_vault_details(HLP) -> {}", summary);
395            tally.passed += 1;
396        }
397        Err(e) => { fail_rest!("get_vault_details", e); tally.failed += 1; }
398    }
399
400    tally
401}
Source

pub async fn get_non_funding_ledger_updates( &self, user: &str, start_time: i64, end_time: Option<i64>, ) -> ExchangeResult<Value>

Get non-funding ledger entries for a user (deposits, withdrawals, internal transfers).

POSTs {"type":"userNonFundingLedgerUpdates","user":"<addr>","startTime":<ms>} to /info. Returns an array of ledger entries ordered by time ascending. No authentication required — only the wallet address.

Examples found in repository?
examples/e2e_metadata.rs (lines 372-376)
307async fn test_hyperliquid_rest() -> RestTally {
308    println!("\n── Hyperliquid REST ─────────────────────────────────────────");
309    let mut tally = RestTally { exchange: "Hyperliquid".into(), tested: 0, passed: 0, failed: 0 };
310
311    let conn = match HyperliquidConnector::public(false).await {
312        Ok(c) => c,
313        Err(e) => {
314            println!("  FAIL: connector init -> {}", e);
315            tally.failed += 1;
316            tally.tested += 1;
317            return tally;
318        }
319    };
320
321    // get_meta_and_asset_ctxs
322    tally.tested += 1;
323    match conn.get_meta_and_asset_ctxs().await {
324        Ok(v) => {
325            let summary = if v.is_array() {
326                format!("[{} elements]", v.as_array().map(|a| a.len()).unwrap_or(0))
327            } else {
328                abbrev(&v)
329            };
330            println!("  OK:   get_meta_and_asset_ctxs -> {}", summary);
331            tally.passed += 1;
332        }
333        Err(e) => { fail_rest!("get_meta_and_asset_ctxs", e); tally.failed += 1; }
334    }
335
336    // get_predicted_fundings
337    tally.tested += 1;
338    match conn.get_predicted_fundings().await {
339        Ok(v) => {
340            let summary = if v.is_array() {
341                format!("[{} entries]", v.as_array().map(|a| a.len()).unwrap_or(0))
342            } else {
343                abbrev(&v)
344            };
345            println!("  OK:   get_predicted_fundings -> {}", summary);
346            tally.passed += 1;
347        }
348        Err(e) => { fail_rest!("get_predicted_fundings", e); tally.failed += 1; }
349    }
350
351    // NEW: get_spot_meta_and_asset_ctxs
352    tally.tested += 1;
353    match conn.get_spot_meta_and_asset_ctxs().await {
354        Ok(v) => {
355            let summary = if v.is_array() {
356                format!("[{} elements]", v.as_array().map(|a| a.len()).unwrap_or(0))
357            } else {
358                abbrev(&v)
359            };
360            println!("  OK:   get_spot_meta_and_asset_ctxs -> {}", summary);
361            tally.passed += 1;
362        }
363        Err(e) => { fail_rest!("get_spot_meta_and_asset_ctxs", e); tally.failed += 1; }
364    }
365
366    // NEW: get_non_funding_ledger_updates (zero address — expect empty array)
367    tally.tested += 1;
368    let now_ms = std::time::SystemTime::now()
369        .duration_since(std::time::UNIX_EPOCH)
370        .map(|d| d.as_millis() as i64)
371        .unwrap_or(0);
372    match conn.get_non_funding_ledger_updates(
373        "0x0000000000000000000000000000000000000000",
374        0,
375        Some(now_ms),
376    ).await {
377        Ok(v) => {
378            let summary = if v.is_array() {
379                format!("[{} entries]", v.as_array().map(|a| a.len()).unwrap_or(0))
380            } else {
381                abbrev(&v)
382            };
383            println!("  OK:   get_non_funding_ledger_updates(zero_addr) -> {}", summary);
384            tally.passed += 1;
385        }
386        Err(e) => { fail_rest!("get_non_funding_ledger_updates", e); tally.failed += 1; }
387    }
388
389    // NEW: get_vault_details (HLP vault)
390    tally.tested += 1;
391    match conn.get_vault_details("0xa15099a30bbf2e68942d6f4c43d70d04faeab0a0").await {
392        Ok(v) => {
393            let summary = if v.is_null() { "null (unknown vault)".to_string() } else { abbrev(&v) };
394            println!("  OK:   get_vault_details(HLP) -> {}", summary);
395            tally.passed += 1;
396        }
397        Err(e) => { fail_rest!("get_vault_details", e); tally.failed += 1; }
398    }
399
400    tally
401}

Trait Implementations§

Source§

impl Account for HyperliquidConnector

Source§

fn get_balance<'life0, 'async_trait>( &'life0 self, query: BalanceQuery, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<Balance>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get account balances.

For Spot accounts: uses spotClearinghouseState → returns per-token balances. For Perp accounts: uses clearinghouseState → returns USDC balance summary.

No signature required — only wallet address.

Source§

fn get_account_info<'life0, 'async_trait>( &'life0 self, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<AccountInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get account info (permissions, margin summary, balances).

Uses clearinghouseState for perp account metadata.

Source§

fn get_fees<'life0, 'life1, 'async_trait>( &'life0 self, symbol: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = ExchangeResult<FeeInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get fee schedule for the account.

Uses userFees endpoint to get the current tier.

Source§

fn account_capabilities(&self, account_type: AccountType) -> AccountCapabilities

Returns the connector’s account capabilities. Read more
Source§

impl AccountLedger for HyperliquidConnector

Source§

fn get_ledger<'life0, 'async_trait>( &'life0 self, filter: LedgerFilter, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<LedgerEntry>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the account ledger — all balance change entries matching the filter. Read more
Source§

impl AccountTransfers for HyperliquidConnector

Source§

fn transfer<'life0, 'async_trait>( &'life0 self, req: TransferRequest, ) -> Pin<Box<dyn Future<Output = ExchangeResult<TransferResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Transfer USDC between Spot and Perp wallets.

Uses the usdClassTransfer action on /exchange.

  • Spot → Perp: from_account = Spot, to_account = FuturesCrosstoPerp: true
  • Perp → Spot: from_account = FuturesCross, to_account = SpottoPerp: false

Only USDC transfers between Spot and Perp are supported. Other asset/account combinations return UnsupportedOperation.

Source§

fn get_transfer_history<'life0, 'async_trait>( &'life0 self, _filter: TransferHistoryFilter, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<TransferResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get transfer history between Spot and Perp.

Hyperliquid does not expose a transfer history endpoint — returns empty vec.

Source§

impl AmendOrder for HyperliquidConnector

Source§

fn amend_order<'life0, 'async_trait>( &'life0 self, req: AmendRequest, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Order>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Modify a live order using the native modify action on /exchange.

Hyperliquid’s modify action requires the full order spec (asset, side, price, size, reduce_only, order type) alongside the order ID to amend.

Source§

impl BatchOrders for HyperliquidConnector

Source§

fn place_orders_batch<'life0, 'async_trait>( &'life0 self, orders: Vec<OrderRequest>, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<OrderResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Place multiple orders in a single native batch request.

Hyperliquid’s order action natively accepts an array of orders — this IS the batch endpoint. Uses grouping="na" (no bracket/TP-SL grouping).

Source§

fn cancel_orders_batch<'life0, 'life1, 'async_trait>( &'life0 self, order_ids: Vec<String>, symbol: Option<&'life1 str>, _account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<OrderResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Cancel multiple orders in a single native batch request.

Hyperliquid’s cancel action natively accepts an array of {a, o} pairs. symbol hint is used to look up the asset index; all order IDs are assumed to belong to the same asset if a symbol is provided.

Source§

fn max_batch_place_size(&self) -> usize

Maximum number of orders allowed in a single batch place request. Read more
Source§

fn max_batch_cancel_size(&self) -> usize

Maximum number of orders allowed in a single batch cancel request.
Source§

impl CancelAll for HyperliquidConnector

Source§

fn cancel_all_orders<'life0, 'async_trait>( &'life0 self, scope: CancelScope, _account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<CancelAllResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Cancel all open orders, optionally scoped to a symbol.

Hyperliquid has no native cancel-all endpoint. Implementation:

  1. Fetch all open orders via POST /info {"type": "openOrders", "user": "0x..."}
  2. Filter by symbol if scope is BySymbol or All { symbol: Some(...) }
  3. Send a single batch cancel via POST /exchange with all (asset, oid) pairs

This is a single batch cancel request — NOT a loop over cancel_order.

Source§

impl CustodialFunds for HyperliquidConnector

Source§

fn get_deposit_address<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, asset: &'life1 str, network: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = ExchangeResult<DepositAddress>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get the deposit address for an asset on a given network. Read more
Source§

fn withdraw<'life0, 'async_trait>( &'life0 self, req: WithdrawRequest, ) -> Pin<Box<dyn Future<Output = ExchangeResult<WithdrawResponse>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Submit a withdrawal request.
Source§

fn get_funds_history<'life0, 'async_trait>( &'life0 self, filter: FundsHistoryFilter, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<FundsRecord>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get deposit and/or withdrawal history.
Source§

impl ExchangeIdentity for HyperliquidConnector

Source§

fn exchange_id(&self) -> ExchangeId

Уникальный идентификатор биржи Read more
Source§

fn metrics(&self) -> ConnectorStats

Runtime metrics snapshot for this connector. Read more
Source§

fn is_testnet(&self) -> bool

Работаем ли с тестовой сетью Read more
Source§

fn supported_account_types(&self) -> Vec<AccountType>

Список поддерживаемых типов аккаунтов Read more
Source§

fn exchange_type(&self) -> ExchangeType

Тип биржи (централизованная, децентрализованная, гибрид) Read more
Source§

fn rate_limit_capabilities(&self) -> RateLimitCapabilities

Static rate limit capabilities for this exchange. Read more
Source§

fn orderbook_capabilities( &self, _account_type: AccountType, ) -> OrderbookCapabilities

Static L2 orderbook capabilities for the given account type. Read more
Source§

fn exchange_name(&self) -> &'static str

Человекочитаемое имя биржи Read more
Source§

impl FundingHistory for HyperliquidConnector

Source§

fn get_funding_payments<'life0, 'async_trait>( &'life0 self, filter: FundingFilter, _account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<FundingPayment>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get historical funding payments from POST /info with type: userFunding.

The wallet address is taken from credentials (api_key). No cryptographic signature is required for this endpoint — only the address in the request body.

Source§

impl HasCapabilities for HyperliquidConnector

Source§

fn capabilities(&self) -> ConnectorCapabilities

Return a declarative map of what this connector supports.
Source§

fn validation_status(&self) -> Option<&'static ValidationStamp>

Empirical validation results from the last e2e_smoke harness run. Read more
Source§

impl MarketData for HyperliquidConnector

Source§

fn get_price<'life0, 'life1, 'async_trait>( &'life0 self, symbol: SymbolInput<'life1>, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Price>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Получить текущую цену символа
Source§

fn get_orderbook<'life0, 'life1, 'async_trait>( &'life0 self, symbol: SymbolInput<'life1>, _depth: Option<u16>, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<OrderBook>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Получить книгу ордеров
Source§

fn get_klines<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, symbol: SymbolInput<'life1>, interval: &'life2 str, limit: Option<u16>, account_type: AccountType, end_time: Option<i64>, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<Kline>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Получить свечи (klines) Read more
Source§

fn get_ticker<'life0, 'life1, 'async_trait>( &'life0 self, symbol: SymbolInput<'life1>, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Ticker>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Получить 24h тикер
Source§

fn ping<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ExchangeResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Проверить соединение (ping)
Source§

fn get_exchange_info<'life0, 'async_trait>( &'life0 self, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<SymbolInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Получить информацию о всех торговых символах биржи Read more
Source§

fn market_data_capabilities( &self, _account_type: AccountType, ) -> MarketDataCapabilities

Returns the connector’s market data capabilities. Read more
Source§

impl MarketDataPublic for HyperliquidConnector

Source§

fn get_recent_trades<'life0, 'life1, 'async_trait>( &'life0 self, symbol: SymbolInput<'life1>, _limit: Option<u32>, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<PublicTrade>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Recent public trades for a symbol.
Source§

fn get_liquidation_history<'life0, 'life1, 'async_trait>( &'life0 self, symbol: Option<SymbolInput<'life1>>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<u32>, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<Liquidation>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Historical liquidation events, optionally filtered by symbol and time range.
Source§

fn get_open_interest_history<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, symbol: SymbolInput<'life1>, period: &'life2 str, start_time: Option<i64>, end_time: Option<i64>, limit: Option<u32>, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<OpenInterest>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Historical open interest snapshots.
Source§

fn get_premium_index<'life0, 'life1, 'async_trait>( &'life0 self, symbol: Option<SymbolInput<'life1>>, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<MarkPrice>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Mark price and index price snapshot(s) for a symbol. Read more
Source§

fn get_long_short_ratio_history<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, symbol: SymbolInput<'life1>, period: &'life2 str, start_time: Option<i64>, end_time: Option<i64>, limit: Option<u32>, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<LongShortRatio>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Historical long/short ratio snapshots.
Source§

fn get_mark_price_klines<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, symbol: SymbolInput<'life1>, interval: &'life2 str, limit: Option<u32>, account_type: AccountType, end_time: Option<i64>, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<Kline>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Mark price klines (OHLCV based on mark price).
Source§

fn get_index_price_klines<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, symbol: SymbolInput<'life1>, interval: &'life2 str, limit: Option<u32>, account_type: AccountType, end_time: Option<i64>, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<Kline>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Index price klines (OHLCV based on index/spot price).
Source§

fn get_funding_rate_history<'life0, 'life1, 'async_trait>( &'life0 self, symbol: SymbolInput<'life1>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<u32>, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<FundingRate>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Historical funding rate payments.
Source§

impl Positions for HyperliquidConnector

Source§

fn get_positions<'life0, 'async_trait>( &'life0 self, query: PositionQuery, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<Position>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get open perpetual positions.

Uses clearinghouseState — no signature required, only wallet address.

Source§

fn get_funding_rate<'life0, 'life1, 'async_trait>( &'life0 self, symbol: &'life1 str, _account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<FundingRate>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the current funding rate for a perpetual symbol.

Uses metaAndAssetCtxs to find the symbol’s funding rate.

Source§

fn get_mark_price<'life0, 'life1, 'async_trait>( &'life0 self, symbol: &'life1 str, ) -> Pin<Box<dyn Future<Output = ExchangeResult<MarkPrice>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the current mark price for a perpetual symbol.

Uses metaAndAssetCtxs — the same endpoint as get_funding_rate — and extracts markPx and oraclePx from the asset context at the symbol index.

metaAndAssetCtxs response: [{universe:[{name,szDecimals,...}]}, [{markPx,oraclePx,funding,...},...]]

Source§

fn modify_position<'life0, 'async_trait>( &'life0 self, req: PositionModification, ) -> Pin<Box<dyn Future<Output = ExchangeResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Modify a position — leverage, margin mode, add/remove margin, or close.

Supported modifications:

  • SetLeverage: POST /exchange updateLeverage
  • SetMarginMode: POST /exchange updateLeverage with isCross flag
  • AddMargin: POST /exchange updateIsolatedMargin (positive ntli)
  • RemoveMargin: POST /exchange updateIsolatedMargin (negative ntli)
  • ClosePosition: place a reduce-only market order for the full position size

Unsupported: SetTpSl (Hyperliquid TP/SL is set at order placement, not separately)

Source§

fn get_open_interest<'life0, 'life1, 'async_trait>( &'life0 self, symbol: &'life1 str, _account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<OpenInterest>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get open interest for a perpetual/futures symbol. Read more
Source§

fn get_closed_pnl<'life0, 'life1, 'async_trait>( &'life0 self, symbol: Option<&'life1 str>, start_time: Option<u64>, end_time: Option<u64>, limit: Option<u32>, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<ClosedPnlRecord>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the closed position P&L history. Read more
Source§

fn get_long_short_ratio<'life0, 'life1, 'async_trait>( &'life0 self, symbol: &'life1 str, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<LongShortRatio>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the long/short account ratio for a symbol. Read more
Source§

impl SubAccounts for HyperliquidConnector

Source§

fn sub_account_operation<'life0, 'async_trait>( &'life0 self, op: SubAccountOperation, ) -> Pin<Box<dyn Future<Output = ExchangeResult<SubAccountResult>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Perform a sub-account operation (create, list, transfer, get balance). Read more
Source§

impl Trading for HyperliquidConnector

Source§

fn place_order<'life0, 'async_trait>( &'life0 self, req: OrderRequest, ) -> Pin<Box<dyn Future<Output = ExchangeResult<PlaceOrderResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Place an order on Hyperliquid.

Supported order types:

  • Market (implemented as aggressive IOC limit)
  • Limit (GTC)
  • PostOnly (ALO — Add-Liquidity-Only)
  • IOC
  • FOK
  • StopMarket (trigger order, tpsl=“sl”, isMarket=true)
  • StopLimit (trigger order, tpsl=“sl”, isMarket=false)
  • ReduceOnly (limit or market with reduce_only=true)

Unsupported: TrailingStop, OCO, Bracket, Iceberg, TWAP, GTD

Source§

fn cancel_order<'life0, 'async_trait>( &'life0 self, req: CancelRequest, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Order>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Cancel an order (single, batch, all, or by symbol).

Returns the first cancelled order’s state (or a placeholder for batch/all).

Source§

fn get_order<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _symbol: &'life1 str, order_id: &'life2 str, _account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Order>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get the current state of a single order by ID.

Requires authentication (wallet address).

Source§

fn get_open_orders<'life0, 'life1, 'async_trait>( &'life0 self, symbol: Option<&'life1 str>, _account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<Order>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get all open orders, optionally filtered by symbol.

Requires authentication (wallet address).

Source§

fn get_order_history<'life0, 'async_trait>( &'life0 self, filter: OrderHistoryFilter, _account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<Order>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get order history (fills / closed orders).

Uses userFills for recent fills or historicalOrders for order history. Requires authentication (wallet address).

Source§

fn get_user_trades<'life0, 'async_trait>( &'life0 self, filter: UserTradeFilter, _account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<UserTrade>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch trade fills for the authenticated wallet address.

Uses userFillsByTime when a time range is specified, otherwise falls back to userFills (returns up to the last 2000 fills). No authentication signature needed — only the wallet address.

Source§

fn trading_capabilities(&self, account_type: AccountType) -> TradingCapabilities

Returns the connector’s trading capabilities. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CoreConnector for T

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Downcast to a concrete connector for exchange-specific inherent methods. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> AmendConnector for T

Source§

impl<T> BatchConnector for T

Source§

impl<T> CancelAllConnector for T

Source§

impl<T> PositionsConnector for T

Source§

impl<T> TradingWithMarketData for T