pub struct Client(/* private fields */);
Expand description
Represents a client for the Autonomi network.
Implementations§
Source§impl Client
impl Client
pub fn into_reference(val: Client, env: Env) -> Result<Reference<Client>>
pub fn into_instance(self, env: Env) -> Result<ClassInstance<Client>>
Source§impl Client
impl Client
Sourcepub async fn init() -> Result<Self>
pub async fn init() -> Result<Self>
Initialize the client with default configuration.
See init_with_config
.
Sourcepub async fn init_local() -> Result<Self>
pub async fn init_local() -> Result<Self>
Initialize a client that is configured to be local.
See init_with_config
.
Sourcepub async fn init_alpha() -> Result<Self>
pub async fn init_alpha() -> Result<Self>
Initialize a client that is configured to be connected to the alpha network.
Sourcepub async fn init_with_peers(peers: Vec<String>) -> Result<Self>
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.
pub fn evm_network(&self) -> Network
Sourcepub async fn chunk_get(&self, addr: &ChunkAddress) -> Result<Buffer>
pub async fn chunk_get(&self, addr: &ChunkAddress) -> Result<Buffer>
Get a chunk from the network.
Sourcepub async fn chunk_put(
&self,
data: Buffer,
payment_option: &PaymentOption,
) -> Result<ChunkPut>
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.
Sourcepub async fn chunk_cost(&self, addr: &ChunkAddress) -> Result<String>
pub async fn chunk_cost(&self, addr: &ChunkAddress) -> Result<String>
Get the cost of a chunk.
Sourcepub async fn graph_entry_get(
&self,
address: &GraphEntryAddress,
) -> Result<GraphEntry>
pub async fn graph_entry_get( &self, address: &GraphEntryAddress, ) -> Result<GraphEntry>
Fetches a GraphEntry from the network.
Sourcepub async fn graph_entry_check_existance(
&self,
address: &GraphEntryAddress,
) -> Result<bool>
pub async fn graph_entry_check_existance( &self, address: &GraphEntryAddress, ) -> Result<bool>
Check if a graph_entry exists on the network
Sourcepub async fn graph_entry_put(
&self,
entry: &GraphEntry,
payment_option: &PaymentOption,
) -> Result<GraphEntryPut>
pub async fn graph_entry_put( &self, entry: &GraphEntry, payment_option: &PaymentOption, ) -> Result<GraphEntryPut>
Manually puts a GraphEntry to the network.
Sourcepub async fn graph_entry_cost(&self, key: &PublicKey) -> Result<String>
pub async fn graph_entry_cost(&self, key: &PublicKey) -> Result<String>
Get the cost to create a GraphEntry
Sourcepub async fn pointer_get(&self, address: &PointerAddress) -> Result<Pointer>
pub async fn pointer_get(&self, address: &PointerAddress) -> Result<Pointer>
Get a pointer from the network
Sourcepub async fn pointer_check_existance(
&self,
address: &PointerAddress,
) -> Result<bool>
pub async fn pointer_check_existance( &self, address: &PointerAddress, ) -> Result<bool>
Check if a pointer exists on the network
Sourcepub fn pointer_verify(pointer: &Pointer) -> Result<()>
pub fn pointer_verify(pointer: &Pointer) -> Result<()>
Verify a pointer
Sourcepub async fn pointer_put(
&self,
pointer: &Pointer,
payment_option: &PaymentOption,
) -> Result<PointerPut>
pub async fn pointer_put( &self, pointer: &Pointer, payment_option: &PaymentOption, ) -> Result<PointerPut>
Manually store a pointer on the network
Sourcepub async fn pointer_create(
&self,
owner: &SecretKey,
target: &PointerTarget,
payment_option: &PaymentOption,
) -> Result<PointerPut>
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
Sourcepub async fn pointer_update(
&self,
owner: &SecretKey,
target: &PointerTarget,
) -> Result<()>
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.
Sourcepub async fn pointer_cost(&self, key: &PublicKey) -> Result<String>
pub async fn pointer_cost(&self, key: &PublicKey) -> Result<String>
Calculate the cost of storing a pointer
Sourcepub async fn scratchpad_get_from_public_key(
&self,
public_key: &PublicKey,
) -> Result<Scratchpad>
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.
Sourcepub async fn scratchpad_get(
&self,
address: &ScratchpadAddress,
) -> Result<Scratchpad>
pub async fn scratchpad_get( &self, address: &ScratchpadAddress, ) -> Result<Scratchpad>
Get Scratchpad from the Network
Sourcepub async fn scratchpad_check_existance(
&self,
address: &ScratchpadAddress,
) -> Result<bool>
pub async fn scratchpad_check_existance( &self, address: &ScratchpadAddress, ) -> Result<bool>
Check if a scratchpad exists on the network
Sourcepub fn scratchpad_verify(scratchpad: &Scratchpad) -> Result<()>
pub fn scratchpad_verify(scratchpad: &Scratchpad) -> Result<()>
Verify a scratchpad
Sourcepub async fn scratchpad_put(
&self,
scratchpad: &Scratchpad,
payment_option: &PaymentOption,
) -> Result<ScratchpadPut>
pub async fn scratchpad_put( &self, scratchpad: &Scratchpad, payment_option: &PaymentOption, ) -> Result<ScratchpadPut>
Manually store a scratchpad on the network
Sourcepub async fn scratchpad_create(
&self,
owner: &SecretKey,
content_type: BigInt,
initial_data: Buffer,
payment_option: &PaymentOption,
) -> Result<ScratchpadPut>
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.
Sourcepub async fn scratchpad_update(
&self,
owner: &SecretKey,
content_type: BigInt,
data: Buffer,
) -> Result<()>
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.
Sourcepub async fn scratchpad_cost(&self, owner: &PublicKey) -> Result<String>
pub async fn scratchpad_cost(&self, owner: &PublicKey) -> Result<String>
Get the cost of creating a new Scratchpad
Sourcepub async fn data_get(&self, data_map: &DataMapChunk) -> Result<Buffer>
pub async fn data_get(&self, data_map: &DataMapChunk) -> Result<Buffer>
Fetch a blob of (private) data from the network
Sourcepub async fn data_put(
&self,
data: Buffer,
payment_option: &PaymentOption,
) -> Result<DataPutResult>
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.
Sourcepub async fn data_get_public(&self, addr: &DataAddress) -> Result<Buffer>
pub async fn data_get_public(&self, addr: &DataAddress) -> Result<Buffer>
Fetch a blob of data from the network
Sourcepub async fn data_put_public(
&self,
data: Buffer,
payment_option: &PaymentOption,
) -> Result<DataPutPublicResult>
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.
Sourcepub async fn data_cost(&self, data: Buffer) -> Result<String>
pub async fn data_cost(&self, data: Buffer) -> Result<String>
Get the estimated cost of storing a piece of data.
Sourcepub async fn archive_get(
&self,
addr: &PrivateArchiveDataMap,
) -> Result<PrivateArchive>
pub async fn archive_get( &self, addr: &PrivateArchiveDataMap, ) -> Result<PrivateArchive>
Fetch a PrivateArchive from the network
Sourcepub async fn archive_put(
&self,
archive: &PrivateArchive,
payment_option: &PaymentOption,
) -> Result<ArchivePutResult>
pub async fn archive_put( &self, archive: &PrivateArchive, payment_option: &PaymentOption, ) -> Result<ArchivePutResult>
Upload a PrivateArchive to the network
Sourcepub async fn archive_get_public(
&self,
addr: &ArchiveAddress,
) -> Result<PublicArchive>
pub async fn archive_get_public( &self, addr: &ArchiveAddress, ) -> Result<PublicArchive>
Fetch an archive from the network
Sourcepub async fn archive_put_public(
&self,
archive: &PublicArchive,
payment_option: &PaymentOption,
) -> Result<ArchivePutPublicResult>
pub async fn archive_put_public( &self, archive: &PublicArchive, payment_option: &PaymentOption, ) -> Result<ArchivePutPublicResult>
Upload an archive to the network
Sourcepub async fn archive_cost(&self, archive: &PublicArchive) -> Result<String>
pub async fn archive_cost(&self, archive: &PublicArchive) -> Result<String>
Get the cost to upload an archive
Sourcepub async fn file_download(
&self,
data_map: &DataMapChunk,
to_dest: String,
) -> Result<()>
pub async fn file_download( &self, data_map: &DataMapChunk, to_dest: String, ) -> Result<()>
Download a private file from network to local file system
Sourcepub async fn dir_download(
&self,
archive_access: &PrivateArchiveDataMap,
to_dest: String,
) -> Result<()>
pub async fn dir_download( &self, archive_access: &PrivateArchiveDataMap, to_dest: String, ) -> Result<()>
Download a private directory from network to local file system
Sourcepub async fn dir_content_upload(
&self,
dir_path: String,
payment_option: &PaymentOption,
) -> Result<DirContentUpload>
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.
Sourcepub async fn dir_upload(
&self,
dir_path: String,
payment_option: &PaymentOption,
) -> Result<DirUpload>
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.
Sourcepub async fn file_content_upload(
&self,
path: String,
payment_option: &PaymentOption,
) -> Result<FileContentUpload>
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)
Sourcepub async fn file_download_public(
&self,
data_addr: &DataAddress,
to_dest: String,
) -> Result<()>
pub async fn file_download_public( &self, data_addr: &DataAddress, to_dest: String, ) -> Result<()>
Download file from network to local file system
Sourcepub async fn dir_download_public(
&self,
archive_addr: &ArchiveAddress,
to_dest: String,
) -> Result<()>
pub async fn dir_download_public( &self, archive_addr: &ArchiveAddress, to_dest: String, ) -> Result<()>
Download directory from network to local file system
Sourcepub async fn dir_content_upload_public(
&self,
dir_path: String,
payment_option: &PaymentOption,
) -> Result<DirContentUploadPublic>
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.
Sourcepub async fn dir_upload_public(
&self,
dir_path: String,
payment_option: &PaymentOption,
) -> Result<DirUploadPublic>
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.
Sourcepub async fn file_content_upload_public(
&self,
_path: String,
_payment_option: &PaymentOption,
) -> Result<FileContentUploadPublic>
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)
Sourcepub async fn file_cost(&self, path: String) -> Result<String>
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
Sourcepub async fn get_user_data_from_vault(
&self,
secret_key: &VaultSecretKey,
) -> Result<UserData>
pub async fn get_user_data_from_vault( &self, secret_key: &VaultSecretKey, ) -> Result<UserData>
Get the user data from the vault
Sourcepub async fn put_user_data_to_vault(
&self,
secret_key: &VaultSecretKey,
payment_option: &PaymentOption,
user_data: &UserData,
) -> Result<String>
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
Sourcepub async fn fetch_and_decrypt_vault(
&self,
secret_key: &VaultSecretKey,
) -> Result<FetchAndDecryptVault>
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.
Sourcepub async fn vault_cost(
&self,
owner: &VaultSecretKey,
max_size: BigInt,
) -> Result<String>
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
Sourcepub async fn write_bytes_to_vault(
&self,
data: Buffer,
payment_option: &PaymentOption,
secret_key: &VaultSecretKey,
content_type: &VaultContentType,
) -> Result<String>
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.
Sourcepub fn register_history(&self, addr: &RegisterAddress) -> RegisterHistory
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.
Sourcepub fn register_key_from_name(owner: &SecretKey, name: String) -> SecretKey
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.
Sourcepub fn register_value_from_bytes(bytes: &[u8]) -> Result<Uint8Array>
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
Sourcepub async fn register_create(
&self,
owner: &SecretKey,
initial_value: Uint8Array,
payment_option: &PaymentOption,
) -> Result<RegisterCreate>
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
Sourcepub async fn register_update(
&self,
owner: &SecretKey,
new_value: Uint8Array,
payment_option: &PaymentOption,
) -> Result<String>
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
Sourcepub async fn register_get(&self, addr: &RegisterAddress) -> Result<Uint8Array>
pub async fn register_get(&self, addr: &RegisterAddress) -> Result<Uint8Array>
Get the current value of the register
Sourcepub async fn register_cost(&self, owner: &PublicKey) -> Result<String>
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
impl FromNapiMutRef for Client
Source§unsafe fn from_napi_mut_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static mut Self>
unsafe fn from_napi_mut_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static mut Self>
Source§impl FromNapiRef for Client
impl FromNapiRef for Client
Source§unsafe fn from_napi_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static Self>
unsafe fn from_napi_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static Self>
Source§impl FromNapiValue for &Client
impl FromNapiValue for &Client
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl FromNapiValue for &mut Client
impl FromNapiValue for &mut Client
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl ToNapiValue for Client
impl ToNapiValue for Client
Source§unsafe fn to_napi_value(env: napi_env, val: Client) -> Result<napi_value>
unsafe fn to_napi_value(env: napi_env, val: Client) -> Result<napi_value>
Source§impl ValidateNapiValue for &Client
impl ValidateNapiValue for &Client
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Source§impl ValidateNapiValue for &mut Client
impl ValidateNapiValue for &mut Client
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> JsValuesTupleIntoVec for Twhere
T: ToNapiValue,
impl<T> JsValuesTupleIntoVec for Twhere
T: ToNapiValue,
fn into_vec(self, env: *mut napi_env__) -> Result<Vec<*mut napi_value__>, Error>
Source§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg
or
a color-specific method, such as OwoColorize::green
, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read moreSource§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Source§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
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
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
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
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.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
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.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
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.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
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.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
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.