Skip to main content

SurfnetCheatcodesClient

Struct SurfnetCheatcodesClient 

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

The Client.

Implementations§

Source§

impl Client

Source

pub fn new(sender: RpcChannel) -> Self

Creates a new Client.

Source

pub fn set_account( &self, pubkey: String, update: AccountUpdate, ) -> impl Future<Output = RpcResult<RpcResponse<()>>>

A “cheat code” method for developers to set or update an account in Surfpool.

This method allows developers to set or update the lamports, data, owner, executable status, and rent epoch of a given account.

§Parameters
  • pubkey: The public key of the account to be updated, as a base-58 encoded string.
  • update: The AccountUpdate struct containing the fields to update the account.
§Returns

A RpcResponse<()> indicating whether the account update was successful.

§Example Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_setAccount",
  "params": ["account_pubkey", {"lamports": 1000, "data": "base58string", "owner": "program_pubkey"}]
}
§Example Response
{
  "jsonrpc": "2.0",
  "result": {},
  "id": 1
}
§Notes

This method is designed to help developers set or modify account properties within Surfpool. Developers can quickly test or update account attributes, such as lamports, program ownership, and executable status.

§See Also
  • getAccount, getAccountInfo, getAccountBalance
Source

pub fn set_token_account( &self, owner: String, mint: String, update: TokenAccountUpdate, token_program: Option<String>, ) -> impl Future<Output = RpcResult<RpcResponse<()>>>

A “cheat code” method for developers to set or update a token account in Surfpool.

This method allows developers to set or update various properties of a token account, including the token amount, delegate, state, delegated amount, and close authority.

§Parameters
  • owner: The base-58 encoded public key of the token account’s owner.
  • mint: The base-58 encoded public key of the token mint (e.g., the token type).
  • update: The TokenAccountUpdate struct containing the fields to update the token account.
  • token_program: The optional base-58 encoded address of the token program (defaults to the system token program).
§Returns

A RpcResponse<()> indicating whether the token account update was successful.

§Example Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_setTokenAccount",
  "params": ["owner_pubkey", "mint_pubkey", {"amount": 1000, "state": "initialized"}]
}
§Example Response
{
  "jsonrpc": "2.0",
  "result": {},
  "id": 1
}
§Notes

This method is designed to help developers quickly test or modify token account properties in Surfpool. Developers can update attributes such as token amounts, delegates, and authorities for specific token accounts.

§See Also
  • getTokenAccountInfo, getTokenAccountBalance, getTokenAccountDelegate
Source

pub fn clone_program_account( &self, source_program_id: String, destination_program_id: String, ) -> impl Future<Output = RpcResult<RpcResponse<()>>>

Source

pub fn profile_transaction( &self, transaction_data: String, tag: Option<String>, config: Option<RpcProfileResultConfig>, ) -> impl Future<Output = RpcResult<RpcResponse<UiKeyedProfileResult>>>

Estimates the compute units that a given transaction will consume.

This method simulates the transaction without committing its state changes and returns an estimation of the compute units used, along with logs and potential errors.

§Parameters
  • transaction_data: A base64 encoded string of the VersionedTransaction.
  • tag: An optional tag for the transaction.
  • encoding: An optional encoding for returned account data.
§Returns

A RpcResponse<ProfileResult> containing the estimation details and a snapshot of the accounts before and after execution.

§Example Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_profileTransaction",
  "params": ["base64_encoded_transaction_string", "optional_tag"]
}
Source

pub fn get_profile_results_by_tag( &self, tag: String, config: Option<RpcProfileResultConfig>, ) -> impl Future<Output = RpcResult<RpcResponse<Option<Vec<UiKeyedProfileResult>>>>>

Retrieves all profiling results for a given tag.

§Parameters
  • tag: The tag to retrieve profiling results for.
§Returns

A RpcResponse<Vec<ProfileResult>> containing the profiling results.

Source

pub fn set_supply( &self, update: SupplyUpdate, ) -> impl Future<Output = RpcResult<RpcResponse<()>>>

A “cheat code” method for developers to set or update the network supply information in Surfpool.

This method allows developers to configure the total supply, circulating supply, non-circulating supply, and non-circulating accounts list that will be returned by the getSupply RPC method.

§Parameters
  • update: The SupplyUpdate struct containing the optional fields to update:
    • total: Optional total supply in lamports
    • circulating: Optional circulating supply in lamports
    • non_circulating: Optional non-circulating supply in lamports
    • non_circulating_accounts: Optional list of non-circulating account addresses
§Returns

A RpcResponse<()> indicating whether the supply update was successful.

§Example Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_setSupply",
  "params": [{
    "total": 1000000000000000,
    "circulating": 800000000000000,
    "non_circulating": 200000000000000,
    "non_circulating_accounts": ["Account1...", "Account2..."]
  }]
}
§Example Response
{
  "jsonrpc": "2.0",
  "result": {},
  "id": 1
}
§Notes

This method is designed to help developers test supply-related functionality by allowing them to configure the values returned by getSupply without needing to connect to a real network or manipulate actual token supplies.

§See Also
  • getSupply
Source

pub fn set_program_authority( &self, program_id_str: String, new_authority_str: Option<String>, ) -> impl Future<Output = RpcResult<RpcResponse<()>>>

A cheat code to set the upgrade authority of a program’s ProgramData account.

This method allows developers to directly patch the upgrade authority of a program’s ProgramData account.

§Parameters
  • program_id: The base-58 encoded public key of the program.
  • new_authority: The base-58 encoded public key of the new authority. If omitted, the program will have no upgrade authority.
§Returns

A RpcResponse<()> indicating whether the authority update was successful.

§Example Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_setProgramAuthority",
  "params": [
    "PROGRAM_ID_BASE58",
    "NEW_AUTHORITY_BASE58"
  ]
}
§Example Response
{
  "jsonrpc": "2.0",
  "result": {},
  "id": 1
}
Source

pub fn get_transaction_profile( &self, signature_or_uuid: UuidOrSignature, config: Option<RpcProfileResultConfig>, ) -> impl Future<Output = RpcResult<RpcResponse<Option<UiKeyedProfileResult>>>>

A cheat code to get the transaction profile for a given signature or UUID.

§Parameters
  • signature_or_uuid: The transaction signature (as a base-58 string) or a UUID (as a string) for which to retrieve the profile.
§Returns

A RpcResponse<Option<ProfileResult>> containing the transaction profile if found, or None if not found.

§Example Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_getTransactionProfile",
  "params": [
    "5Nf3...TxSignatureOrUuidHere"
  ]
}
§Example Response
{
  "jsonrpc": "2.0",
  "context": {
    "slot": 355684457,
    "apiVersion": "2.2.2"
  },
  "value": { /* ...ProfileResult object... */ },
  "id": 1
}
Source

pub fn register_idl( &self, idl: Idl, slot: Option<Slot>, ) -> impl Future<Output = RpcResult<RpcResponse<()>>>

A cheat code to register an IDL for a given program in memory.

§Parameters
  • idl: The full IDL object to be registered in memory. The address field should match the program’s public key.
  • slot (optional): The slot at which to register the IDL. If omitted, uses the latest slot.
§Returns

A RpcResponse<()> indicating whether the IDL registration was successful.

§Example Request (with slot)
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_registerIdl",
  "params": [
    {
      "address": "4EXSeLGxVBpAZwq7vm6evLdewpcvE2H56fpqL2pPiLFa",
      "metadata": {
        "name": "test",
        "version": "0.1.0",
        "spec": "0.1.0",
        "description": "Created with Anchor"
      },
      "instructions": [
        {
          "name": "initialize",
          "discriminator": [175,175,109,31,13,152,155,237],
          "accounts": [],
          "args": []
        }
      ],
      "accounts": [],
      "types": [],
      "events": [],
      "errors": [],
      "constants": [],
      "state": null
    },
    355684457
  ]
}
§Example Request (without slot)
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_registerIdl",
  "params": [
    {
      "address": "4EXSeLGxVBpAZwq7vm6evLdewpcvE2H56fpqL2pPiLFa",
      "metadata": {
        "name": "test",
        "version": "0.1.0",
        "spec": "0.1.0",
        "description": "Created with Anchor"
      },
      "instructions": [
        {
          "name": "initialize",
          "discriminator": [175,175,109,31,13,152,155,237],
          "accounts": [],
          "args": []
        }
      ],
      "accounts": [],
      "types": [],
      "events": [],
      "errors": [],
      "constants": [],
      "state": null
    }
  ]
}
§Example Response
{
  "jsonrpc": "2.0",
  "context": {
    "slot": 355684457,
    "apiVersion": "2.2.2"
  },
  "value": null,
  "id": 1
}
Source

pub fn get_idl( &self, program_id: String, slot: Option<Slot>, ) -> impl Future<Output = RpcResult<RpcResponse<Option<Idl>>>>

A cheat code to get the registered IDL for a given program ID.

§Parameters
  • program_id: The base-58 encoded public key of the program whose IDL is being requested.
  • slot (optional): The slot at which to query the IDL. If omitted, uses the latest slot.
§Returns

A RpcResponse<Option<Idl>> containing the IDL if it exists, or None if not found.

§Example Request (with slot)
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_getIdl",
  "params": [
    "4EXSeLGxVBpAZwq7vm6evLdewpcvE2H56fpqL2pPiLFa",
    355684457
  ]
}
§Example Request (without slot)
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_getIdl",
  "params": [
    "4EXSeLGxVBpAZwq7vm6evLdewpcvE2H56fpqL2pPiLFa"
  ]
}
§Example Response
{
  "jsonrpc": "2.0",
  "context": {
    "slot": 355684457,
    "apiVersion": "2.2.2"
  },
  "value": { /* ...IDL object... */ },
  "id": 1
}
Source

pub fn get_local_signatures( &self, limit: Option<u64>, ) -> impl Future<Output = RpcResult<RpcResponse<Vec<RpcLogsResponse>>>>

A cheat code to get the last 50 local signatures from the local network.

§Example Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_getLocalSignatures",
  "params": [ { "limit": 50 } ]
}

## Example Response
```json
{
  "jsonrpc": "2.0",
  "result": {
    "signature": String,
    "err": Option<TransactionError>,
    "slot": u64,
  },
  "id": 1
}
Source

pub fn time_travel( &self, config: Option<TimeTravelConfig>, ) -> impl Future<Output = RpcResult<EpochInfo>>

A cheat code to jump forward or backward in time on the local network. Useful for testing epoch-based or time-sensitive logic.

§Parameters
  • config (optional): A TimeTravelConfig specifying how to modify the clock:
    • absoluteTimestamp(u64): Moves time to the specified UNIX timestamp.
    • absoluteSlot(u64): Moves to the specified absolute slot.
    • absoluteEpoch(u64): Advances time to the specified epoch (each epoch = 432,000 slots).
§Returns

An EpochInfo object reflecting the updated clock state.

§Example Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_timeTravel",
  "params": [ { "absoluteSlot": 512 } ]
}
§Example Response
{
  "jsonrpc": "2.0",
  "result": {
    "epoch": 512,
    "slot_index": 0,
    "slots_in_epoch": 432000,
    "absolute_slot": 221184000,
    "block_height": 650000000,
    "transaction_count": 923472834
  },
  "id": 1
}
Source

pub fn pause_clock(&self) -> impl Future<Output = RpcResult<EpochInfo>>

A cheat code to freeze the Surfnet clock on the local network. All time progression halts until resumed.

§Returns

An EpochInfo object showing the current clock state at the moment of pause.

§Example Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_pauseClock",
  "params": []
}
§Example Response
{
  "jsonrpc": "2.0",
  "result": {
    "epoch": 512,
    "slot_index": 0,
    "slots_in_epoch": 432000,
    "absolute_slot": 221184000,
    "block_height": 650000000,
    "transaction_count": 923472834
  },
  "id": 1
}
Source

pub fn resume_clock(&self) -> impl Future<Output = RpcResult<EpochInfo>>

A cheat code to resume Solana clock progression after it was paused. The validator will start producing new slots again.

§Parameters
§Returns

An EpochInfo object reflecting the resumed clock state.

§Example Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_resumeClock",
  "params": []
}
§Example Response
{
  "jsonrpc": "2.0",
  "result": {
    "epoch": 512,
    "slot_index": 0,
    "slots_in_epoch": 432000,
    "absolute_slot": 221184000,
    "block_height": 650000000,
    "transaction_count": 923472834
  },
  "id": 1
}
Source

pub fn reset_account( &self, pubkey_str: String, config: Option<ResetAccountConfig>, ) -> impl Future<Output = RpcResult<RpcResponse<()>>>

A cheat code to reset an account on the local network.

§Parameters
  • pubkey_str: The base-58 encoded public key of the account to reset.
  • config: A ResetAccountConfig specifying how to reset the account. If omitted, the account will be reset without cascading to owned accounts.
§Returns

An RpcResponse<()> indicating whether the account reset was successful.

§Example Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_resetAccount",
  "params": [ "4EXSeLGxVBpAZwq7vm6evLdewpcvE2H56fpqL2pPiLFa", { "includeOwnedAccounts": true } ]
}
§Example Response
{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "slot": 123456789,
      "apiVersion": "2.3.8"
    },
    "value": null
  },
  "id": 1
}
Source

pub fn reset_network(&self) -> impl Future<Output = RpcResult<RpcResponse<()>>>

A cheat code to reset a network.

§Returns

An RpcResponse<()> indicating whether the network reset was successful.

§Example Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_resetNetwork",    /// }
§Example Response
{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "slot": 123456789,
      "apiVersion": "2.3.8"
    },
    "value": null    ///   },
  "id": 1
}
Source

pub fn export_snapshot( &self, config: Option<ExportSnapshotConfig>, ) -> impl Future<Output = RpcResult<RpcResponse<BTreeMap<String, AccountSnapshot>>>>

A cheat code to export a snapshot of all accounts in the Surfnet SVM.

This method retrieves the current state of all accounts stored in the Surfnet Virtual Machine (SVM) and returns them as a mapping of account public keys to their respective account snapshots.

§Parameters
  • config: An optional ExportSnapshotConfig to customize the export behavior. The config fields are:
    • includeParsedAccounts: If true, includes parsed account data in the snapshot.
    • filter: An optional filter config to limit which accounts are included in the snapshot. Fields include:
      • includeProgramAccounts: A boolean indicating whether to include program accounts.
      • includeAccounts: A list of specific account public keys to include.
      • excludeAccounts: A list of specific account public keys to exclude.
    • scope: An optional scope to limit the accounts included in the snapshot. Options include:
      • network: Includes all accounts in the network.
      • preTransaction: Only includes accounts touched by the given transaction.
§Returns

An RpcResponse<BTreeMap<String, AccountSnapshot>> containing the exported account snapshots.

The keys of the map are the base-58 encoded public keys of the accounts, and the values are the corresponding AccountSnapshot objects.

§Example Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_exportSnapshot"
}
§Example Response
{
  "jsonrpc": "2.0",
  "result": {
    "4EXSeLGxVBpAZwq7vm6evLdewpcvE2H56fpqL2pPiLFa": {
      "lamports": 1000000,
      "owner": "11111111111111111111111111111111",
      "executable": false,
      "rent_epoch": 0,
      "data": "base64_encoded_data_string"
    },
    "AnotherAccountPubkeyBase58": {
      "lamports": 500000,
      "owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
      "executable": false,
      "rent_epoch": 0,
      "data": "base64_encoded_data_string"
    }
  },
  "id": 1
}
Source

pub fn stream_account( &self, pubkey_str: String, config: Option<StreamAccountConfig>, ) -> impl Future<Output = RpcResult<RpcResponse<()>>>

A cheat code to simulate account streaming. When a transaction is processed, the accounts that are accessed are downloaded from the datasource and cached in the SVM. With this method, you can simulate the streaming of accounts by providing a pubkey.

§Parameters
  • pubkey_str: The base-58 encoded public key of the account to stream.
  • config: A StreamAccountConfig specifying how to stream the account. If omitted, the account will be streamed without cascading to owned accounts.
§Returns

An RpcResponse<()> indicating whether the account stream registration was successful.

§Example Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_streamAccount",
  "params": [ "4EXSeLGxVBpAZwq7vm6evLdewpcvE2H56fpqL2pPiLFa", { "includeOwnedAccounts": true } ]
}
§Example Response
{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "slot": 123456789,
      "apiVersion": "2.3.8"
    },
    "value": null
  },
  "id": 1
}
Source

pub fn get_streamed_accounts( &self, ) -> impl Future<Output = RpcResult<RpcResponse<GetStreamedAccountsResponse>>>

A cheat code to retrieve the streamed accounts. When a transaction is processed, the accounts that are accessed are downloaded from the datasource and cached in the SVM. With this method, you can simulate the streaming of accounts by providing a pubkey.

§Parameters
§Returns

An RpcResponse<()> indicating whether the account stream registration was successful.

§Example Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_getStreamedAccounts",
  "params": []
}
§Example Response
{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "slot": 123456789,
      "apiVersion": "2.3.8"
    },
    "value": [
      "4EXSeLGxVBpAZwq7vm6evLdewpcvE2H56fpqL2pPiLFa"
    ]
   },
  "id": 1
}
Source

pub fn get_surfnet_info( &self, ) -> impl Future<Output = RpcResult<RpcResponse<GetSurfnetInfoResponse>>>

A cheat code to get Surfnet network information.

§Returns

A RpcResponse<GetSurfnetInfoResponse> containing the Surfnet network information.

§Example Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_getSurfnetInfo"
}
§Example Response
{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "slot": 369027326,
      "apiVersion": "2.3.8"
    },
    "value": {
      "runbookExecutions": [
        {
          "startedAt": 1758747828,
          "completedAt": 1758747828,
          "runbookId": "deployment"
        }
      ]
    }
  },
  "id": 1
}
Source

pub fn write_program( &self, program_id: String, data: String, offset: usize, authority: Option<String>, ) -> impl Future<Output = RpcResult<RpcResponse<()>>>

A “cheat code” method for developers to write program data at a specified offset in Surfpool.

This method allows developers to write large Solana programs by sending data in chunks, bypassing transaction size limits by using RPC size limits (5MB) instead.

§Parameters
  • program_id: The public key of the program account, as a base-58 encoded string.
  • data: Hex-encoded program data chunk to write.
  • offset: The byte offset at which to write this data chunk.
  • authority (optional): The base-58 encoded public key of the authority allowed to write to the program. If omitted, defaults to the system program.
§Returns

A RpcResponse<()> indicating whether the write was successful.

§Example Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_writeProgram",
  "params": [
    "program_pubkey",
    "deadbeef...",
    0
  ]
}
§Example Response
{
  "jsonrpc": "2.0",
  "result": {},
  "id": 1
}
§Notes

This method is designed to help developers deploy large programs by writing data incrementally. Multiple calls can be made with different offsets to build the complete program. The program account and program data account will be created automatically if they don’t exist.

Source

pub fn register_scenario( &self, scenario: Scenario, slot: Option<Slot>, ) -> impl Future<Output = RpcResult<RpcResponse<()>>>

A cheat code to register a scenario with account overrides.

§Parameters
  • scenario: The Scenario object containing:
    • id: Unique identifier for the scenario
    • name: Human-readable name
    • description: Description of the scenario
    • overrides: Array of OverrideInstance objects, each containing:
      • id: Unique identifier for this override instance
      • templateId: Reference to the override template
      • values: HashMap of field paths to override values
      • scenarioRelativeSlot: The relative slot offset (from base slot) when this override should be applied
      • label: Optional label for this override
      • enabled: Whether this override is active
      • fetchBeforeUse: If true, fetch fresh account data just before transaction execution (useful for price feeds, oracle updates, and dynamic balances)
      • account: Account address (either { "pubkey": "..." } or { "pda": { "programId": "...", "seeds": [...] } })
    • tags: Array of tags for categorization
  • slot (optional): The base slot from which relative slot offsets are calculated. If omitted, uses the current slot.
§Returns

A RpcResponse<()> indicating whether the Scenario registration was successful.

§Example Request (with slot)
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_registerScenario",
  "params": [
    {
      "id": "scenario-1",
      "name": "Price Feed Override",
      "description": "Override Pyth BTC/USD price at specific slots",
      "overrides": [
        {
          "id": "override-1",
          "templateId": "pyth_btcusd",
          "values": {
            "price_message.price_value": 67500,
            "price_message.conf": 100,
            "price_message.expo": -8
          },
          "scenarioRelativeSlot": 100,
          "label": "Set BTC price to $67,500",
          "enabled": true,
          "fetchBeforeUse": false,
          "account": {
            "pubkey": "H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4QJNYH"
          }
        }
      ],
      "tags": ["defi", "price-feed"]
    },
    355684457
  ]
}
§Example Request (without slot)
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "surfnet_registerScenario",
  "params": [
    {
      "id": "scenario-1",
      "name": "Price Feed Override",
      "description": "Override Pyth BTC/USD price",
      "overrides": [
        {
          "id": "override-1",
          "templateId": "pyth_btcusd",
          "values": {
            "price_message.price_value": 67500
          },
          "scenarioRelativeSlot": 100,
          "label": "Set BTC price",
          "enabled": true,
          "fetchBeforeUse": true,
          "account": {
            "pubkey": "H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4QJNYH"
          }
        }
      ],
      "tags": []
    }
  ]
}
§Example Response
{
  "jsonrpc": "2.0",
  "context": {
    "slot": 355684457,
    "apiVersion": "2.2.2"
  },
  "value": null,
  "id": 1
}

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl From<RpcChannel> for Client

Source§

fn from(channel: RpcChannel) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> AggregateExpressionMethods for T

Source§

fn aggregate_distinct(self) -> Self::Output
where Self: DistinctDsl,

DISTINCT modifier for aggregate functions Read more
Source§

fn aggregate_all(self) -> Self::Output
where Self: AllDsl,

ALL modifier for aggregate functions Read more
Source§

fn aggregate_filter<P>(self, f: P) -> Self::Output
where P: AsExpression<Bool>, Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,

Add an aggregate function filter Read more
Source§

fn aggregate_order<O>(self, o: O) -> Self::Output
where Self: OrderAggregateDsl<O>,

Add an aggregate function order Read more
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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

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

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

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

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Sync + Send>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoSql for T

Source§

fn into_sql<T>(self) -> Self::Expression

Convert self to an expression for Diesel’s query builder. Read more
Source§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
where &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

Convert &self to an expression for Diesel’s query builder. Read more
Source§

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

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
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> WindowExpressionMethods for T

Source§

fn over(self) -> Self::Output
where Self: OverDsl,

Turn a function call into a window function call Read more
Source§

fn window_filter<P>(self, f: P) -> Self::Output
where P: AsExpression<Bool>, Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,

Add a filter to the current window function Read more
Source§

fn partition_by<E>(self, expr: E) -> Self::Output
where Self: PartitionByDsl<E>,

Add a partition clause to the current window function Read more
Source§

fn window_order<E>(self, expr: E) -> Self::Output
where Self: OrderWindowDsl<E>,

Add a order clause to the current window function Read more
Source§

fn frame_by<E>(self, expr: E) -> Self::Output
where Self: FrameDsl<E>,

Add a frame clause to the current window function Read more
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