ShadowDriveClient

Struct ShadowDriveClient 

Source
pub struct ShadowDriveClient<T>
where T: Signer,
{ /* private fields */ }
Expand description

Client that allows a user to interact with the Shadow Drive.

Implementations§

Source§

impl<T> ShadowDriveClient<T>
where T: Signer,

Source

pub async fn add_immutable_storage( &self, storage_account_key: &Pubkey, size: Byte, ) -> ShadowDriveResult<StorageResponse>

Adds storage capacity to the specified immutable StorageAccount. This will fail if the StorageAccount is not immutable.

  • storage_account_key - The public key of the immutable StorageAccount.
  • size - The additional amount of storage you want to add. E.g if you have an existing StorageAccount with 1MB of storage but you need 2MB total, size should equal 1MB. When specifying size, only KB, MB, and GB storage units are currently supported.
§Example
let add_immutable_storage_response = shdw_drive_client
    .add_immutable_storage(storage_account_key, Byte::from_str("1MB").expect("invalid byte string"))
    .await?;
Source§

impl<T> ShadowDriveClient<T>
where T: Signer,

Source

pub async fn add_storage( &self, storage_account_key: &Pubkey, size: Byte, ) -> ShadowDriveResult<StorageResponse>

Adds storage capacity to the specified StorageAccount.

  • storage_account_key - The public key of the StorageAccount.
  • size - The additional amount of storage you want to add. E.g if you have an existing StorageAccount with 1MB of storage but you need 2MB total, size should equal 1MB. When specifying size, only KB, MB, and GB storage units are currently supported.
§Example
let add_storage_response = shdw_drive_client
    .add_storage(&storage_account_key, added_bytes)
    .await?;
Source§

impl<T> ShadowDriveClient<T>
where T: Signer,

Source

pub async fn cancel_delete_storage_account( &self, storage_account_key: &Pubkey, ) -> ShadowDriveResult<ShdwDriveResponse>

Unmarks a StorageAccount for deletion from the Shadow Drive. To prevent deletion, this method must be called before the end of the Solana epoch in which delete_storage_account is called.

  • storage_account_key - The public key of the StorageAccount that you want to unmark for deletion.
§Example
let cancel_delete_storage_account_response = shdw_drive_client
    .cancel_delete_storage_account(&storage_account_key)
    .await?;
Source§

impl<T> ShadowDriveClient<T>
where T: Signer,

Source

pub async fn claim_stake( &self, storage_account_key: &Pubkey, ) -> ShadowDriveResult<ShdwDriveResponse>

Claims any available stake as a result of the reduce_storage command. After reducing storage amount, users must wait until the end of the epoch to successfully claim their stake.

  • storage_account_key - The public key of the StorageAccount that you want to claim excess stake from.
§Example
let claim_stake = shdw_drive_client
    .claim_stake(&storage_account_key)
    .await?;
Source§

impl<T> ShadowDriveClient<T>
where T: Signer,

Source

pub async fn create_storage_account( &self, name: &str, size: Byte, version: StorageAccountVersion, ) -> ShadowDriveResult<CreateStorageAccountResponse>

Creates a StorageAccount on the Shadow Drive. [StorageAccount]’s can hold multiple files, and are paid for using the SHDW token.

  • name - The name of the StorageAccount. Does not need to be unique.
  • size - The amount of storage the StorageAccount should be initialized with. When specifying size, only KB, MB, and GB storage units are currently supported.
Examples found in repository?
examples/end_to_end.rs (lines 24-28)
9async fn main() {
10    // Get keypair
11    let keypair_file: String = std::env::args()
12        .skip(1)
13        .next()
14        .expect("no keypair file provided");
15    let keypair: Keypair = read_keypair_file(keypair_file).expect("failed to read keypair file");
16    println!("loaded keypair");
17
18    // Initialize client
19    let client = ShadowDriveClient::new(keypair, SOLANA_MAINNET_RPC);
20    println!("initialized client");
21
22    // Create account
23    let response = client
24        .create_storage_account(
25            "test",
26            Byte::from_bytes(2_u128.pow(20)),
27            shadow_drive_sdk::StorageAccountVersion::V2,
28        )
29        .await
30        .expect("failed to create storage account");
31    let account = Pubkey::from_str(&response.shdw_bucket.unwrap()).unwrap();
32    println!("created storage account");
33
34    // Upload files
35    let files: Vec<ShadowFile> = vec![
36        ShadowFile::file("alpha.txt".to_string(), "./examples/files/alpha.txt"),
37        ShadowFile::file(
38            "not_alpha.txt".to_string(),
39            "./examples/files/not_alpha.txt",
40        ),
41    ];
42    let response = client
43        .store_files(&account, files.clone())
44        .await
45        .expect("failed to upload files");
46    println!("uploaded files");
47    for url in &response.finalized_locations {
48        println!("    {url}")
49    }
50    // Try editing
51    for file in files {
52        let response = client
53            .edit_file(&account, file)
54            .await
55            .expect("failed to upload files");
56        assert!(!response.finalized_location.is_empty(), "failed edit");
57        println!("edited file: {}", response.finalized_location);
58    }
59
60    // Delete files
61    for url in response.finalized_locations {
62        client
63            .delete_file(&account, url)
64            .await
65            .expect("failed to delete files");
66    }
67    println!("deleted files");
68
69    // Delete account
70    client
71        .delete_storage_account(&account)
72        .await
73        .expect("failed to delete storage account");
74    println!("deleted account");
75}
Source§

impl<T> ShadowDriveClient<T>
where T: Signer,

Source

pub async fn delete_file( &self, storage_account_key: &Pubkey, url: String, ) -> ShadowDriveResult<DeleteFileResponse>

Marks a file for deletion from the Shadow Drive. Files marked for deletion are deleted at the end of each Solana epoch. Marking a file for deletion can be undone with cancel_delete_file, but this must be done before the end of the Solana epoch.

  • storage_account_key - The public key of the StorageAccount that contains the file.
  • url - The Shadow Drive url of the file you want to mark for deletion.
§Example
let delete_file_response = shdw_drive_client
    .delete_file(&storage_account_key, url)
    .await?;
Examples found in repository?
examples/end_to_end.rs (line 63)
9async fn main() {
10    // Get keypair
11    let keypair_file: String = std::env::args()
12        .skip(1)
13        .next()
14        .expect("no keypair file provided");
15    let keypair: Keypair = read_keypair_file(keypair_file).expect("failed to read keypair file");
16    println!("loaded keypair");
17
18    // Initialize client
19    let client = ShadowDriveClient::new(keypair, SOLANA_MAINNET_RPC);
20    println!("initialized client");
21
22    // Create account
23    let response = client
24        .create_storage_account(
25            "test",
26            Byte::from_bytes(2_u128.pow(20)),
27            shadow_drive_sdk::StorageAccountVersion::V2,
28        )
29        .await
30        .expect("failed to create storage account");
31    let account = Pubkey::from_str(&response.shdw_bucket.unwrap()).unwrap();
32    println!("created storage account");
33
34    // Upload files
35    let files: Vec<ShadowFile> = vec![
36        ShadowFile::file("alpha.txt".to_string(), "./examples/files/alpha.txt"),
37        ShadowFile::file(
38            "not_alpha.txt".to_string(),
39            "./examples/files/not_alpha.txt",
40        ),
41    ];
42    let response = client
43        .store_files(&account, files.clone())
44        .await
45        .expect("failed to upload files");
46    println!("uploaded files");
47    for url in &response.finalized_locations {
48        println!("    {url}")
49    }
50    // Try editing
51    for file in files {
52        let response = client
53            .edit_file(&account, file)
54            .await
55            .expect("failed to upload files");
56        assert!(!response.finalized_location.is_empty(), "failed edit");
57        println!("edited file: {}", response.finalized_location);
58    }
59
60    // Delete files
61    for url in response.finalized_locations {
62        client
63            .delete_file(&account, url)
64            .await
65            .expect("failed to delete files");
66    }
67    println!("deleted files");
68
69    // Delete account
70    client
71        .delete_storage_account(&account)
72        .await
73        .expect("failed to delete storage account");
74    println!("deleted account");
75}
Source§

impl<T> ShadowDriveClient<T>
where T: Signer,

Source

pub async fn delete_storage_account( &self, storage_account_key: &Pubkey, ) -> ShadowDriveResult<ShdwDriveResponse>

Marks a StorageAccount for deletion from the Shadow Drive. If an account is marked for deletion, all files within the account will be deleted as well. Any stake remaining in the StorageAccount will be refunded to the creator. Accounts marked for deletion are deleted at the end of each Solana epoch. Marking a StorageAccount for deletion can be undone with cancel_delete_storage_account, but this must be done before the end of the Solana epoch.

  • storage_account_key - The public key of the StorageAccount that you want to mark for deletion.
§Example
let delete_storage_account_response = shdw_drive_client
    .delete_storage_account(&storage_account_key)
    .await?;
Examples found in repository?
examples/end_to_end.rs (line 71)
9async fn main() {
10    // Get keypair
11    let keypair_file: String = std::env::args()
12        .skip(1)
13        .next()
14        .expect("no keypair file provided");
15    let keypair: Keypair = read_keypair_file(keypair_file).expect("failed to read keypair file");
16    println!("loaded keypair");
17
18    // Initialize client
19    let client = ShadowDriveClient::new(keypair, SOLANA_MAINNET_RPC);
20    println!("initialized client");
21
22    // Create account
23    let response = client
24        .create_storage_account(
25            "test",
26            Byte::from_bytes(2_u128.pow(20)),
27            shadow_drive_sdk::StorageAccountVersion::V2,
28        )
29        .await
30        .expect("failed to create storage account");
31    let account = Pubkey::from_str(&response.shdw_bucket.unwrap()).unwrap();
32    println!("created storage account");
33
34    // Upload files
35    let files: Vec<ShadowFile> = vec![
36        ShadowFile::file("alpha.txt".to_string(), "./examples/files/alpha.txt"),
37        ShadowFile::file(
38            "not_alpha.txt".to_string(),
39            "./examples/files/not_alpha.txt",
40        ),
41    ];
42    let response = client
43        .store_files(&account, files.clone())
44        .await
45        .expect("failed to upload files");
46    println!("uploaded files");
47    for url in &response.finalized_locations {
48        println!("    {url}")
49    }
50    // Try editing
51    for file in files {
52        let response = client
53            .edit_file(&account, file)
54            .await
55            .expect("failed to upload files");
56        assert!(!response.finalized_location.is_empty(), "failed edit");
57        println!("edited file: {}", response.finalized_location);
58    }
59
60    // Delete files
61    for url in response.finalized_locations {
62        client
63            .delete_file(&account, url)
64            .await
65            .expect("failed to delete files");
66    }
67    println!("deleted files");
68
69    // Delete account
70    client
71        .delete_storage_account(&account)
72        .await
73        .expect("failed to delete storage account");
74    println!("deleted account");
75}
Source§

impl<T> ShadowDriveClient<T>
where T: Signer,

Source

pub async fn edit_file( &self, storage_account_key: &Pubkey, data: ShadowFile, ) -> ShadowDriveResult<ShadowEditResponse>

Replace an existing file on the Shadow Drive with the given updated file.

  • storage_account_key - The public key of the StorageAccount that contains the file.
  • url - The Shadow Drive url of the file you want to replace.
  • data - The updated ShadowFile.
§Example
let edit_file_response = shdw_drive_client
    .edit_file(&storage_account_key, url, file)
    .await?;
Examples found in repository?
examples/end_to_end.rs (line 53)
9async fn main() {
10    // Get keypair
11    let keypair_file: String = std::env::args()
12        .skip(1)
13        .next()
14        .expect("no keypair file provided");
15    let keypair: Keypair = read_keypair_file(keypair_file).expect("failed to read keypair file");
16    println!("loaded keypair");
17
18    // Initialize client
19    let client = ShadowDriveClient::new(keypair, SOLANA_MAINNET_RPC);
20    println!("initialized client");
21
22    // Create account
23    let response = client
24        .create_storage_account(
25            "test",
26            Byte::from_bytes(2_u128.pow(20)),
27            shadow_drive_sdk::StorageAccountVersion::V2,
28        )
29        .await
30        .expect("failed to create storage account");
31    let account = Pubkey::from_str(&response.shdw_bucket.unwrap()).unwrap();
32    println!("created storage account");
33
34    // Upload files
35    let files: Vec<ShadowFile> = vec![
36        ShadowFile::file("alpha.txt".to_string(), "./examples/files/alpha.txt"),
37        ShadowFile::file(
38            "not_alpha.txt".to_string(),
39            "./examples/files/not_alpha.txt",
40        ),
41    ];
42    let response = client
43        .store_files(&account, files.clone())
44        .await
45        .expect("failed to upload files");
46    println!("uploaded files");
47    for url in &response.finalized_locations {
48        println!("    {url}")
49    }
50    // Try editing
51    for file in files {
52        let response = client
53            .edit_file(&account, file)
54            .await
55            .expect("failed to upload files");
56        assert!(!response.finalized_location.is_empty(), "failed edit");
57        println!("edited file: {}", response.finalized_location);
58    }
59
60    // Delete files
61    for url in response.finalized_locations {
62        client
63            .delete_file(&account, url)
64            .await
65            .expect("failed to delete files");
66    }
67    println!("deleted files");
68
69    // Delete account
70    client
71        .delete_storage_account(&account)
72        .await
73        .expect("failed to delete storage account");
74    println!("deleted account");
75}
Source§

impl<T> ShadowDriveClient<T>
where T: Signer,

Source

pub async fn get_storage_account( &self, key: &Pubkey, ) -> ShadowDriveResult<StorageAcct>

Returns the StorageAccount associated with the pubkey provided by a user.

§Example
let storage_account = shdw_drive_client
    .get_storage_account(&storage_account_key)
    .await
    .expect("failed to get storage account");
Source

pub async fn get_storage_accounts( &self, owner: &Pubkey, ) -> ShadowDriveResult<Vec<StorageAcct>>

Returns all [StorageAccount]s associated with the public key provided by a user.

  • owner - The public key that is the owner of all the returned [StorageAccount]s.
§Example
let storage_accounts = shdw_drive_client
    .get_storage_accounts(&user_pubkey)
    .await
    .expect("failed to get storage account");
Source§

impl<T> ShadowDriveClient<T>
where T: Signer,

Source

pub async fn list_objects( &self, storage_account_key: &Pubkey, ) -> ShadowDriveResult<Vec<String>>

Gets a list of all files associated with a storage account. The output contains all of the file names as strings.

  • storage_account_key - The public key of the StorageAccount that owns the files.
§Example
let files = shdw_drive_client
    .list_objects(&storage_account_key)
    .await?;
Source§

impl<T> ShadowDriveClient<T>
where T: Signer,

Source

pub async fn make_storage_immutable( &self, storage_account_key: &Pubkey, ) -> ShadowDriveResult<StorageResponse>

Permanently locks a StorageAccount and all contained files. After a StorageAccount has been locked, a user will no longer be able to delete/edit files, add/reduce storage amount, or delete the StorageAccount.

  • storage_account_key - The public key of the StorageAccount that will be made immutable.
§Example
let make_immutable_response = shdw_drive_client
    .make_storage_immutable(&storage_account_key)
    .await?;
Source§

impl<T> ShadowDriveClient<T>
where T: Signer,

Source

pub async fn migrate( &self, storage_account_key: &Pubkey, ) -> ShadowDriveResult<(ShdwDriveResponse, ShdwDriveResponse)>

Migrates a v1 StorageAccount to v2. This requires two separate transactions to reuse the original pubkey. To minimize chance of failure, it is recommended to call this method with a commitment level of Finalized

  • storage_account_key - The public key of the StorageAccount to be migrated.
§Example
let migrate_response = shdw_drive_client
    .migrate(&storage_account_key)
    .await?;
Source

pub async fn migrate_step_1( &self, storage_account_key: &Pubkey, ) -> ShadowDriveResult<ShdwDriveResponse>

First transaction step that migrates a v1 StorageAccount to v2. Consists of copying the existing account’s data into an intermediate account, and deleting the v1 storage account

Source

pub async fn migrate_step_2( &self, storage_account_key: &Pubkey, ) -> ShadowDriveResult<ShdwDriveResponse>

Second transaction step that migrates a v1 StorageAccount to v2. Consists of recreating the storage account using the original pubkey, and deleting the intermediate account

Source§

impl<T> ShadowDriveClient<T>
where T: Signer,

Source

pub async fn redeem_rent( &self, storage_account_key: &Pubkey, file_account_key: &Pubkey, ) -> ShadowDriveResult<ShdwDriveResponse>

Reclaims the Solana rent from any on-chain file accounts. Older versions of the Shadow Drive used to create accounts for uploaded files.

  • storage_account_key - The public key of the StorageAccount that contained the deleted file.
  • file_account_key - The public key of the File account to be closed.
§Example
let redeem_rent_response = shdw_drive_client
    .redeem_rent(&storage_account_key, &file_account_key)
    .await?;
Source§

impl<T> ShadowDriveClient<T>
where T: Signer,

Source

pub async fn reduce_storage( &self, storage_account_key: &Pubkey, size: Byte, ) -> ShadowDriveResult<StorageResponse>

Reduces the amount of total storage available for the given storage account.

  • storage_account_key - The public key of the StorageAccount whose storage will be reduced.
  • size - The amount of storage you want to remove. E.g if you have an existing StorageAccount with 3MB of storage but you want 2MB total, size should equal 1MB. When specifying size, only KB, MB, and GB storage units are currently supported.
§Example
let reduce_storage_response = shdw_drive_client
    .reduce_storage(&storage_account_key, reduced_bytes)
    .await?;
Source§

impl<T> ShadowDriveClient<T>
where T: Signer,

Source

pub async fn refresh_stake( &self, storage_account_key: &Pubkey, ) -> ShadowDriveResult<ShdwDriveResponse>

Allows user to refresh stake account, and unmarks deletion.

  • storage_account_key - The public key of the StorageAccount that you want to top up stake for.
§Example
let refresh_stake = shdw_drive_client
    .refresh_stake(&storage_account_key)
    .await?;
Source§

impl<T> ShadowDriveClient<T>
where T: Signer,

Source

pub async fn store_files( &self, storage_account_key: &Pubkey, data: Vec<ShadowFile>, ) -> ShadowDriveResult<ShadowUploadResponse>

Examples found in repository?
examples/end_to_end.rs (line 43)
9async fn main() {
10    // Get keypair
11    let keypair_file: String = std::env::args()
12        .skip(1)
13        .next()
14        .expect("no keypair file provided");
15    let keypair: Keypair = read_keypair_file(keypair_file).expect("failed to read keypair file");
16    println!("loaded keypair");
17
18    // Initialize client
19    let client = ShadowDriveClient::new(keypair, SOLANA_MAINNET_RPC);
20    println!("initialized client");
21
22    // Create account
23    let response = client
24        .create_storage_account(
25            "test",
26            Byte::from_bytes(2_u128.pow(20)),
27            shadow_drive_sdk::StorageAccountVersion::V2,
28        )
29        .await
30        .expect("failed to create storage account");
31    let account = Pubkey::from_str(&response.shdw_bucket.unwrap()).unwrap();
32    println!("created storage account");
33
34    // Upload files
35    let files: Vec<ShadowFile> = vec![
36        ShadowFile::file("alpha.txt".to_string(), "./examples/files/alpha.txt"),
37        ShadowFile::file(
38            "not_alpha.txt".to_string(),
39            "./examples/files/not_alpha.txt",
40        ),
41    ];
42    let response = client
43        .store_files(&account, files.clone())
44        .await
45        .expect("failed to upload files");
46    println!("uploaded files");
47    for url in &response.finalized_locations {
48        println!("    {url}")
49    }
50    // Try editing
51    for file in files {
52        let response = client
53            .edit_file(&account, file)
54            .await
55            .expect("failed to upload files");
56        assert!(!response.finalized_location.is_empty(), "failed edit");
57        println!("edited file: {}", response.finalized_location);
58    }
59
60    // Delete files
61    for url in response.finalized_locations {
62        client
63            .delete_file(&account, url)
64            .await
65            .expect("failed to delete files");
66    }
67    println!("deleted files");
68
69    // Delete account
70    client
71        .delete_storage_account(&account)
72        .await
73        .expect("failed to delete storage account");
74    println!("deleted account");
75}
Source§

impl<T> ShadowDriveClient<T>
where T: Signer,

Source

pub async fn top_up( &self, storage_account_key: &Pubkey, amount: u64, ) -> ShadowDriveResult<ShdwDriveResponse>

Allows user to top up stake account, transfering some amount of $SHDW.

  • storage_account_key - The public key of the StorageAccount that you want to top up stake for.
  • amount - The amount of $SHDW to transfer into stake account
§Example
let top_up = shdw_drive_client
    .top_up(&storage_account_key, top_up_amount)
    .await?;
Source§

impl<T> ShadowDriveClient<T>
where T: Signer,

Source

pub fn new<U: ToString>(wallet: T, rpc_url: U) -> Self

Creates a new ShadowDriveClient from the given Signer and URL.

  • wallet - A Signer that for signs all transactions generated by the client. Typically this is a user’s keypair.
  • rpc_url - An HTTP URL of a Solana RPC provider.

The underlying Solana RPC client is configured with 120s timeout and a commitment level of confirmed.

To customize RpcClient settings see new_with_rpc.

§Example
use solana_sdk::signer::keypair::Keypair;    

let wallet = Keypair::generate();
let shdw_drive = ShadowDriveClient::new(wallet, "https://ssc-dao.genesysgo.net");
Examples found in repository?
examples/end_to_end.rs (line 19)
9async fn main() {
10    // Get keypair
11    let keypair_file: String = std::env::args()
12        .skip(1)
13        .next()
14        .expect("no keypair file provided");
15    let keypair: Keypair = read_keypair_file(keypair_file).expect("failed to read keypair file");
16    println!("loaded keypair");
17
18    // Initialize client
19    let client = ShadowDriveClient::new(keypair, SOLANA_MAINNET_RPC);
20    println!("initialized client");
21
22    // Create account
23    let response = client
24        .create_storage_account(
25            "test",
26            Byte::from_bytes(2_u128.pow(20)),
27            shadow_drive_sdk::StorageAccountVersion::V2,
28        )
29        .await
30        .expect("failed to create storage account");
31    let account = Pubkey::from_str(&response.shdw_bucket.unwrap()).unwrap();
32    println!("created storage account");
33
34    // Upload files
35    let files: Vec<ShadowFile> = vec![
36        ShadowFile::file("alpha.txt".to_string(), "./examples/files/alpha.txt"),
37        ShadowFile::file(
38            "not_alpha.txt".to_string(),
39            "./examples/files/not_alpha.txt",
40        ),
41    ];
42    let response = client
43        .store_files(&account, files.clone())
44        .await
45        .expect("failed to upload files");
46    println!("uploaded files");
47    for url in &response.finalized_locations {
48        println!("    {url}")
49    }
50    // Try editing
51    for file in files {
52        let response = client
53            .edit_file(&account, file)
54            .await
55            .expect("failed to upload files");
56        assert!(!response.finalized_location.is_empty(), "failed edit");
57        println!("edited file: {}", response.finalized_location);
58    }
59
60    // Delete files
61    for url in response.finalized_locations {
62        client
63            .delete_file(&account, url)
64            .await
65            .expect("failed to delete files");
66    }
67    println!("deleted files");
68
69    // Delete account
70    client
71        .delete_storage_account(&account)
72        .await
73        .expect("failed to delete storage account");
74    println!("deleted account");
75}
Source

pub fn new_with_rpc(wallet: T, rpc_client: RpcClient) -> Self

Creates a new ShadowDriveClient from the given Signer and RpcClient.

  • wallet - A Signer that for signs all transactions generated by the client. Typically this is a user’s keypair.
  • rpc_client - A Solana RpcClient that handles sending transactions and reading accounts from the blockchain.

Providng the RpcClient allows customization of timeout and committment level.

§Example
use solana_client::rpc_client::RpcClient;
use solana_sdk::signer::keypair::Keypair;    
use solana_sdk::commitment_config::CommitmentConfig;

let wallet = Keypair::generate();
let solana_rpc = RpcClient::new_with_commitment("https://ssc-dao.genesysgo.net", CommitmentConfig::confirmed());
let shdw_drive = ShadowDriveClient::new_with_rpc(wallet, solana_rpc);
Source

pub async fn get_object_data( &self, location: &str, ) -> ShadowDriveResult<FileDataResponse>

Source

pub async fn get_storage_account_size( &self, storage_account_key: &str, ) -> ShadowDriveResult<GetBucketSizeResponse>

Auto Trait Implementations§

§

impl<T> !Freeze for ShadowDriveClient<T>

§

impl<T> !RefUnwindSafe for ShadowDriveClient<T>

§

impl<T> Send for ShadowDriveClient<T>
where T: Send,

§

impl<T> Sync for ShadowDriveClient<T>
where T: Sync,

§

impl<T> Unpin for ShadowDriveClient<T>
where T: Unpin,

§

impl<T> !UnwindSafe for ShadowDriveClient<T>

Blanket Implementations§

Source§

impl<T> AbiExample for T

Source§

default fn example() -> T

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> 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> 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> 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> ErasedDestructor for T
where T: 'static,