Struct Client

Source
pub struct Client(/* private fields */);
Expand description

Represents a client for the Autonomi network.

Implementations§

Source§

impl Client

Source

pub fn instance_of<V: NapiRaw>(env: Env, value: V) -> Result<bool>

Source§

impl Client

Source§

impl Client

Source

pub async fn init() -> Result<Self>

Initialize the client with default configuration.

See init_with_config.

Source

pub async fn init_local() -> Result<Self>

Initialize a client that is configured to be local.

See init_with_config.

Source

pub async fn init_alpha() -> Result<Self>

Initialize a client that is configured to be connected to the alpha network.

Source

pub async fn init_with_peers(peers: Vec<String>) -> Result<Self>

Initialize a client that bootstraps from a list of peers.

If any of the provided peers is a global address, the client will not be local.

Source

pub fn evm_network(&self) -> Network

Source

pub async fn chunk_get(&self, addr: &ChunkAddress) -> Result<Buffer>

Get a chunk from the network.

Source

pub async fn chunk_put( &self, data: Buffer, payment_option: &PaymentOption, ) -> Result<ChunkPut>

Manually upload a chunk to the network.

It is recommended to use the data_put method instead to upload data.

Source

pub async fn chunk_cost(&self, addr: &ChunkAddress) -> Result<String>

Get the cost of a chunk.

Source

pub async fn graph_entry_get( &self, address: &GraphEntryAddress, ) -> Result<GraphEntry>

Fetches a GraphEntry from the network.

Source

pub async fn graph_entry_check_existance( &self, address: &GraphEntryAddress, ) -> Result<bool>

Check if a graph_entry exists on the network

Source

pub async fn graph_entry_put( &self, entry: &GraphEntry, payment_option: &PaymentOption, ) -> Result<GraphEntryPut>

Manually puts a GraphEntry to the network.

Source

pub async fn graph_entry_cost(&self, key: &PublicKey) -> Result<String>

Get the cost to create a GraphEntry

Source

pub async fn pointer_get(&self, address: &PointerAddress) -> Result<Pointer>

Get a pointer from the network

Source

pub async fn pointer_check_existance( &self, address: &PointerAddress, ) -> Result<bool>

Check if a pointer exists on the network

Source

pub fn pointer_verify(pointer: &Pointer) -> Result<()>

Verify a pointer

Source

pub async fn pointer_put( &self, pointer: &Pointer, payment_option: &PaymentOption, ) -> Result<PointerPut>

Manually store a pointer on the network

Source

pub async fn pointer_create( &self, owner: &SecretKey, target: &PointerTarget, payment_option: &PaymentOption, ) -> Result<PointerPut>

Create a new pointer on the network.

Make sure that the owner key is not already used for another pointer as each key is associated with one pointer

Source

pub async fn pointer_update( &self, owner: &SecretKey, target: &PointerTarget, ) -> Result<()>

Update an existing pointer to point to a new target on the network.

The pointer needs to be created first with Client::pointer_put. This operation is free as the pointer was already paid for at creation. Only the latest version of the pointer is kept on the Network, previous versions will be overwritten and unrecoverable.

Source

pub async fn pointer_cost(&self, key: &PublicKey) -> Result<String>

Calculate the cost of storing a pointer

Source

pub async fn scratchpad_get_from_public_key( &self, public_key: &PublicKey, ) -> Result<Scratchpad>

Get Scratchpad from the Network. A Scratchpad is stored at the owner’s public key so we can derive the address from it.

Source

pub async fn scratchpad_get( &self, address: &ScratchpadAddress, ) -> Result<Scratchpad>

Get Scratchpad from the Network

Source

pub async fn scratchpad_check_existance( &self, address: &ScratchpadAddress, ) -> Result<bool>

Check if a scratchpad exists on the network

Source

pub fn scratchpad_verify(scratchpad: &Scratchpad) -> Result<()>

Verify a scratchpad

Source

pub async fn scratchpad_put( &self, scratchpad: &Scratchpad, payment_option: &PaymentOption, ) -> Result<ScratchpadPut>

Manually store a scratchpad on the network

Source

pub async fn scratchpad_create( &self, owner: &SecretKey, content_type: BigInt, initial_data: Buffer, payment_option: &PaymentOption, ) -> Result<ScratchpadPut>

Create a new scratchpad to the network.

Make sure that the owner key is not already used for another scratchpad as each key is associated with one scratchpad. The data will be encrypted with the owner key before being stored on the network. The content type is used to identify the type of data stored in the scratchpad, the choice is up to the caller.

Returns the cost and the address of the scratchpad.

Source

pub async fn scratchpad_update( &self, owner: &SecretKey, content_type: BigInt, data: Buffer, ) -> Result<()>

Update an existing scratchpad to the network. The scratchpad needs to be created first with Client::scratchpad_create. This operation is free as the scratchpad was already paid for at creation. Only the latest version of the scratchpad is kept on the Network, previous versions will be overwritten and unrecoverable.

Source

pub async fn scratchpad_cost(&self, owner: &PublicKey) -> Result<String>

Get the cost of creating a new Scratchpad

Source

pub async fn data_get(&self, data_map: &DataMapChunk) -> Result<Buffer>

Fetch a blob of (private) data from the network

Source

pub async fn data_put( &self, data: Buffer, payment_option: &PaymentOption, ) -> Result<DataPutResult>

Upload a piece of private data to the network. This data will be self-encrypted. The DataMapChunk is not uploaded to the network, keeping the data private.

Returns the DataMapChunk containing the map to the encrypted chunks.

Source

pub async fn data_get_public(&self, addr: &DataAddress) -> Result<Buffer>

Fetch a blob of data from the network

Source

pub async fn data_put_public( &self, data: Buffer, payment_option: &PaymentOption, ) -> Result<DataPutPublicResult>

Upload a piece of data to the network. This data is publicly accessible.

Returns the Data Address at which the data was stored.

Source

pub async fn data_cost(&self, data: Buffer) -> Result<String>

Get the estimated cost of storing a piece of data.

Source

pub async fn archive_get( &self, addr: &PrivateArchiveDataMap, ) -> Result<PrivateArchive>

Fetch a PrivateArchive from the network

Source

pub async fn archive_put( &self, archive: &PrivateArchive, payment_option: &PaymentOption, ) -> Result<ArchivePutResult>

Upload a PrivateArchive to the network

Source

pub async fn archive_get_public( &self, addr: &ArchiveAddress, ) -> Result<PublicArchive>

Fetch an archive from the network

Source

pub async fn archive_put_public( &self, archive: &PublicArchive, payment_option: &PaymentOption, ) -> Result<ArchivePutPublicResult>

Upload an archive to the network

Source

pub async fn archive_cost(&self, archive: &PublicArchive) -> Result<String>

Get the cost to upload an archive

Source

pub async fn file_download( &self, data_map: &DataMapChunk, to_dest: String, ) -> Result<()>

Download a private file from network to local file system

Source

pub async fn dir_download( &self, archive_access: &PrivateArchiveDataMap, to_dest: String, ) -> Result<()>

Download a private directory from network to local file system

Source

pub async fn dir_content_upload( &self, dir_path: String, payment_option: &PaymentOption, ) -> Result<DirContentUpload>

Upload the content of all files in a directory to the network. The directory is recursively walked and each file is uploaded to the network.

The data maps of these (private) files are not uploaded but returned within the PrivateArchive return type.

Source

pub async fn dir_upload( &self, dir_path: String, payment_option: &PaymentOption, ) -> Result<DirUpload>

Same as Client::dir_content_upload but also uploads the archive (privately) to the network.

Returns the PrivateArchiveDataMap allowing the private archive to be downloaded from the network.

Source

pub async fn file_content_upload( &self, path: String, payment_option: &PaymentOption, ) -> Result<FileContentUpload>

Upload the content of a private file to the network. Reads file, splits into chunks, uploads chunks, uploads datamap, returns DataMapChunk (pointing to the datamap)

Source

pub async fn file_download_public( &self, data_addr: &DataAddress, to_dest: String, ) -> Result<()>

Download file from network to local file system

Source

pub async fn dir_download_public( &self, archive_addr: &ArchiveAddress, to_dest: String, ) -> Result<()>

Download directory from network to local file system

Source

pub async fn dir_content_upload_public( &self, dir_path: String, payment_option: &PaymentOption, ) -> Result<DirContentUploadPublic>

Upload the content of all files in a directory to the network. The directory is recursively walked and each file is uploaded to the network.

The data maps of these files are uploaded on the network, making the individual files publicly available.

This returns, but does not upload (!),the PublicArchive containing the data maps of the uploaded files.

Source

pub async fn dir_upload_public( &self, dir_path: String, payment_option: &PaymentOption, ) -> Result<DirUploadPublic>

Same as Client::dir_content_upload_public but also uploads the archive to the network.

Returns the ArchiveAddress of the uploaded archive.

Source

pub async fn file_content_upload_public( &self, _path: String, _payment_option: &PaymentOption, ) -> Result<FileContentUploadPublic>

Upload the content of a file to the network. Reads file, splits into chunks, uploads chunks, uploads datamap, returns DataAddr (pointing to the datamap)

Source

pub async fn file_cost(&self, path: String) -> Result<String>

Get the cost to upload a file/dir to the network. quick and dirty implementation, please refactor once files are cleanly implemented

Source

pub async fn get_user_data_from_vault( &self, secret_key: &VaultSecretKey, ) -> Result<UserData>

Get the user data from the vault

Source

pub async fn put_user_data_to_vault( &self, secret_key: &VaultSecretKey, payment_option: &PaymentOption, user_data: &UserData, ) -> Result<String>

Put the user data to the vault

Returns the total cost of the put operation

Source

pub async fn fetch_and_decrypt_vault( &self, secret_key: &VaultSecretKey, ) -> Result<FetchAndDecryptVault>

Retrieves and returns a decrypted vault if one exists.

Returns the content type of the bytes in the vault.

Source

pub async fn vault_cost( &self, owner: &VaultSecretKey, max_size: BigInt, ) -> Result<String>

Get the cost of creating a new vault A quick estimation of cost: num_of_graph_entry * graph_entry_cost + num_of_scratchpad * scratchpad_cost

Source

pub async fn write_bytes_to_vault( &self, data: Buffer, payment_option: &PaymentOption, secret_key: &VaultSecretKey, content_type: &VaultContentType, ) -> Result<String>

Put data into the client’s VaultPacket

Dynamically expand the vault capacity by paying for more space (Scratchpad) when needed.

It is recommended to use the hash of the app name or unique identifier as the content type.

Source

pub fn register_history(&self, addr: &RegisterAddress) -> RegisterHistory

Get the register history, starting from the root to the latest entry.

This returns a RegisterHistory that can be use to get the register values from the history.

RegisterHistory::next can be used to get the values one by one, from the first to the latest entry. RegisterHistory::collect can be used to get all the register values from the history from the first to the latest entry.

Source

pub fn register_key_from_name(owner: &SecretKey, name: String) -> SecretKey

Create a new register key from a SecretKey and a name.

This derives a new SecretKey from the owner’s SecretKey using the name. Note that you will need to keep track of the names you used to create the register key.

Source

pub fn register_value_from_bytes(bytes: &[u8]) -> Result<Uint8Array>

Create a new RegisterValue from bytes, make sure the bytes are not longer than REGISTER_VALUE_SIZE

Source

pub async fn register_create( &self, owner: &SecretKey, initial_value: Uint8Array, payment_option: &PaymentOption, ) -> Result<RegisterCreate>

Create a new register with an initial value.

Note that two payments are required, one for the underlying GraphEntry and one for the crate::Pointer

Source

pub async fn register_update( &self, owner: &SecretKey, new_value: Uint8Array, payment_option: &PaymentOption, ) -> Result<String>

Update the value of a register. The register needs to be created first with autonomi::Client::register_create

Source

pub async fn register_get(&self, addr: &RegisterAddress) -> Result<Uint8Array>

Get the current value of the register

Source

pub async fn register_cost(&self, owner: &PublicKey) -> Result<String>

Get the cost of a register operation. Returns the cost of creation if it doesn’t exist, else returns the cost of an update

Trait Implementations§

Source§

impl FromNapiMutRef for Client

Source§

unsafe fn from_napi_mut_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static mut Self>

Safety Read more
Source§

impl FromNapiRef for Client

Source§

unsafe fn from_napi_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static Self>

Safety Read more
Source§

impl FromNapiValue for &Client

Source§

unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>

Safety Read more
Source§

fn from_unknown(value: JsUnknown) -> Result<Self, Error>

Source§

impl FromNapiValue for &mut Client

Source§

unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>

Safety Read more
Source§

fn from_unknown(value: JsUnknown) -> Result<Self, Error>

Source§

impl ObjectFinalize for Client

Source§

fn finalize(self, env: Env) -> Result<(), Error>

Source§

impl ToNapiValue for Client

Source§

impl TypeName for &Client

Source§

impl TypeName for &mut Client

Source§

impl TypeName for Client

Source§

impl ValidateNapiValue for &Client

Source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

Safety Read more
Source§

impl ValidateNapiValue for &mut Client

Source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

Safety Read more

Auto Trait Implementations§

§

impl Freeze for Client

§

impl RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl UnwindSafe for Client

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<'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> 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> 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> 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> JsValuesTupleIntoVec for T
where T: ToNapiValue,

Source§

impl<D> OwoColorize for D

Source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
Source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
Source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
Source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
Source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
Source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
Source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
Source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
Source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
Source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
Source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
Source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
Source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
Source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
Source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
Source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
Source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
Source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
Source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
Source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
Source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
Source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
Source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
Source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
Source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
Source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
Source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
Source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
Source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
Source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
Source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
Source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
Source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
Source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
Source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
Source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
Source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
Source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
Source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
Source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
Source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
Source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
Source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
Source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
Source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
Source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
Source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
Source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
Source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
Source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
Source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
Source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
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> 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> 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> 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> 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,