Struct sn_client::ClientRegister
source · pub struct ClientRegister {
pub register: Register,
pub ops: LinkedList<RegisterCmd>,
/* private fields */
}
Expand description
Cached operations made to an offline Register instance are applied locally only,
and accumulated until the user explicitly calls ‘sync’. The user can
switch back to sync with the network for every op by invoking online
API.
Fields§
§register: Register
§ops: LinkedList<RegisterCmd>
Implementations§
source§impl ClientRegister
impl ClientRegister
sourcepub fn create_with_addr(client: Client, addr: RegisterAddress) -> Self
pub fn create_with_addr(client: Client, addr: RegisterAddress) -> Self
Create a new Register locally with a specific address.
§Arguments
- ‘client’ - Client
- ‘addr’ - RegisterAddress
§Example
let client = Client::new(SecretKey::random(), None, None, None).await?;
let address = RegisterAddress::new(XorName::random(&mut rng), client.signer_pk());
// Here we create a ClientRegister
let register = ClientRegister::create_with_addr(client.clone(), address);
sourcepub async fn create_online(
client: Client,
meta: XorName,
wallet_client: &mut WalletClient,
verify_store: bool,
perms: Permissions,
) -> Result<(Self, NanoTokens, NanoTokens), Error>
pub async fn create_online( client: Client, meta: XorName, wallet_client: &mut WalletClient, verify_store: bool, perms: Permissions, ) -> Result<(Self, NanoTokens, NanoTokens), Error>
Create a new Register and send it to the Network.
§Arguments
- ‘client’ - Client
- ‘meta’ - XorName
- ‘wallet_client’ - A borrowed mutable WalletClient
verify_store
- A boolean to verify store. Set this to true for mandatory verification.- ‘perms’ - Permissions
Return type: Result<(Self, NanoTokens, NanoTokens)>
§Example
let client = Client::new(SecretKey::random(), None, None, None).await?;
let address = XorName::random(&mut rng);
let mut wallet_client = WalletClient::new(client.clone(), wallet);
let permissions = Permissions::default();
// Instantiate a new Register replica from a predefined address.
// The create_online function runs a [sync](ClientRegister::sync) internally.
let (client_register, mut total_cost, mut total_royalties) = ClientRegister::create_online(
client,
address,
&mut wallet_client,
false,
permissions,
).await?;
sourcepub fn address(&self) -> &RegisterAddress
pub fn address(&self) -> &RegisterAddress
Return type: RegisterAddress
§Example
// Instantiate a ClientRegister (i.e. with create_online)
let (client_register, mut cost, mut royalties) = ClientRegister::create_online//(...)
// From there we can use the address. In this example, we print it out:
println!("REGISTER_ADDRESS={}", client_register.address().to_hex());
sourcepub fn owner(&self) -> PublicKey
pub fn owner(&self) -> PublicKey
Returns the Owner of the Register.
Return type: PublicKey
§Example
// Instantiate a ClientRegister (i.e. with create_online)
let (client_register, mut cost, mut royalties) = ClientRegister::create_online//(...)
// From there we can use the owner. In this example, we print it out:
println!("REGISTER_OWNER={}", client_register.owner().to_hex());
sourcepub fn permissions(&self) -> &Permissions
pub fn permissions(&self) -> &Permissions
Returns the Permissions of the Register.
Return type: Permissions
§Example
let mut wallet_client = WalletClient::new(client.clone(), wallet);
let permissions = Permissions::default();
// Instantiate a ClientRegister (i.e. with create_online)
let (client_register, mut cost, mut royalties) = ClientRegister::create_online//(...)
// From there we can use the permissions. In this example, we print it out:
let permissions = client_register.permissions();
println!("REGISTER_PERMS={:?}",permissions);
sourcepub fn size(&self) -> u64
pub fn size(&self) -> u64
Return the number of items held in the register.
Return type: u64
§Example
// Instantiate a ClientRegister (i.e. with create_online)
let (client_register, mut cost, mut royalties) = ClientRegister::create_online//(...)
// From there we can see the size. In this example, we print it out:
println!("REGISTER_SIZE={}", client_register.size());
sourcepub fn get(&self, hash: EntryHash) -> Result<&Entry, Error>
pub fn get(&self, hash: EntryHash) -> Result<&Entry, Error>
Return a value corresponding to the provided ‘hash’, if present.
sourcepub fn read(&self) -> BTreeSet<(EntryHash, Entry)>
pub fn read(&self) -> BTreeSet<(EntryHash, Entry)>
Read the last entry, or entries when there are branches, if the register is not empty.
Return type: BTreeSet<(EntryHash, Entry)>
§Example
let client = Client::new(SecretKey::random(), None, None, None).await?;
let address = XorName::random(&mut rng);
// Read as bytes into the ClientRegister instance
let register = ClientRegister::create(client.clone(), address).read();
sourcepub fn write(&mut self, entry: &[u8]) -> Result<EntryHash, Error>
pub fn write(&mut self, entry: &[u8]) -> Result<EntryHash, Error>
Write a new value onto the Register atop latest value.
It returns an error if it finds branches in the content/entries; if it is
required to merge/resolve the branches, invoke the write_merging_branches
API.
§Arguments
- ‘entry’ - u8 (i.e .as_bytes)
§Example
let client = Client::new(SecretKey::random(), None, None, None).await?;
let address = XorName::random(&mut rng);
let entry = "Register entry";
// Write as bytes into the ClientRegister instance
let mut register = ClientRegister::create(client.clone(), address).write(entry.as_bytes());
sourcepub fn write_merging_branches(
&mut self,
entry: &[u8],
) -> Result<EntryHash, Error>
pub fn write_merging_branches( &mut self, entry: &[u8], ) -> Result<EntryHash, Error>
Write a new value onto the Register atop of the latest value.
If there are any branches of content or entries, it automatically merges them.
Leaving the new value as a single latest value on the Register.
Note you can use the write
API if you need to handle
content/entries branches in a different way.
§Arguments
- ‘entry’ - u8 (i.e .as_bytes)
§Example
let client = Client::new(SecretKey::random(), None, None, None).await?;
let address = XorName::random(&mut rng);
let entry = "entry_input_here";
let mut mutable_register = ClientRegister::create(client.clone(), address);
let message = "Register entry";
let register = mutable_register.write_merging_branches(message.as_bytes());
sourcepub fn write_atop(
&mut self,
entry: &[u8],
children: &BTreeSet<EntryHash>,
) -> Result<EntryHash, Error>
pub fn write_atop( &mut self, entry: &[u8], children: &BTreeSet<EntryHash>, ) -> Result<EntryHash, Error>
Write a new value onto the Register atop the set of branches/entries
referenced by the provided list of their corresponding entry hash.
Note you can use write_merging_branches
API instead if you
want to write atop all exiting branches/entries.
§Arguments
§Example
let mut rng = rand::thread_rng();
let client = Client::new(SecretKey::random(), None, None, None).await?;
let address = XorName::random(&mut rng);
let mut mutable_register = ClientRegister::create(client.clone(), address);
let meta = "Register entry".as_bytes();
let register = mutable_register.write_atop(meta, &BTreeSet::default());
sourcepub async fn sync(
&mut self,
wallet_client: &mut WalletClient,
verify_store: bool,
payment_info: Option<(Payment, PeerId)>,
) -> Result<(NanoTokens, NanoTokens), Error>
pub async fn sync( &mut self, wallet_client: &mut WalletClient, verify_store: bool, payment_info: Option<(Payment, PeerId)>, ) -> Result<(NanoTokens, NanoTokens), Error>
Sync this Register with the replicas on the network. This will optionally verify the stored Register on the network is the same as the local one. If payment info is provided it won’t try to make the payment.
§Arguments
- ‘wallet_client’ - WalletClient
- ‘verify_store’ - Boolean
Return type: Result<(NanoTokens, NanoTokens)>
§Example
let address = XorName::random(&mut rng);
let client = Client::new(SecretKey::random(), None, None, None).await?;
let mut wallet_client = WalletClient::new(client.clone(), wallet);
// Run sync of a Client Register instance
let mut register =
ClientRegister::create(client, address).sync(&mut wallet_client, true, None).await?;
sourcepub async fn push(&mut self, verify_store: bool) -> Result<(), Error>
pub async fn push(&mut self, verify_store: bool) -> Result<(), Error>
Push all operations made locally to the replicas of this Register on the network. This optionally verifies that the stored Register is the same as our local register.
§Arguments
- ‘verify_store’ - Boolean
§Example
let address = XorName::random(&mut rng);
let client = Client::new(SecretKey::random(), None, None, None).await?;
// Pass the boolean value to the Client Register instance via .Push()
let mut binding = ClientRegister::create(client, address);
let register = binding.push(false);
sourcepub async fn write_online(
&mut self,
entry: &[u8],
verify_store: bool,
) -> Result<(), Error>
pub async fn write_online( &mut self, entry: &[u8], verify_store: bool, ) -> Result<(), Error>
Write a new value onto the Register atop of the latest value.
It returns an error if it finds branches in the content / entries. If so, then it’s
required to merge or resolve the branches. In that case, invoke the write_merging_branches
API.
§Arguments
- ‘entry’ - u8 (i.e .as_bytes)
- ‘verify_store’ - Boolean
§Example
let address = XorName::random(&mut rng);
let client = Client::new(SecretKey::random(), None, None, None).await?;
let meta = "Register entry".as_bytes();
// Use of the 'write_online' example:
let mut binding = ClientRegister::create(client, address);
let register = binding.write_online(meta,false);
sourcepub async fn write_merging_branches_online(
&mut self,
entry: &[u8],
verify_store: bool,
) -> Result<(), Error>
pub async fn write_merging_branches_online( &mut self, entry: &[u8], verify_store: bool, ) -> Result<(), Error>
Write a new value onto the Register atop of the latest value.
If there are branches of content/entries, it will automatically merge them.
This will leave a single new value as the latest entry into the Register.
Note that you can use the write
API if you need to handle content/entries branches in a different way.
§Arguments
- ‘entry’ - u8 (i.e .as_bytes)
- ‘verify_store’ - Boolean
§Example
let address = XorName::random(&mut rng);
let client = Client::new(SecretKey::random(), None, None, None).await?;
let meta = "Entry".as_bytes();
// Use of the 'write_merging_branches_online':
let mut binding = ClientRegister::create(client, address);
let register = binding.write_merging_branches_online(meta,false);
sourcepub async fn write_atop_online(
&mut self,
entry: &[u8],
children: &BTreeSet<EntryHash>,
verify_store: bool,
) -> Result<(), Error>
pub async fn write_atop_online( &mut self, entry: &[u8], children: &BTreeSet<EntryHash>, verify_store: bool, ) -> Result<(), Error>
Write a new value onto the Register atop the set of branches/entries
referenced by the provided list to their corresponding entry hash.
Note you can use write_merging_branches
API if you
want to write atop of all exiting branches/entries instead.
§Arguments
Return type:
§Example
let mut rng = rand::thread_rng();
let address = XorName::random(&mut rng);
let client = Client::new(SecretKey::random(), None, None, None).await?;
let entry = "Entry".as_bytes();
let tree_set = BTreeSet::new();
// Use of the 'write_atop_online':
let mut binding = ClientRegister::create(client, address);
let mut register = binding.write_atop_online(entry,&tree_set,false);
sourcepub fn merkle_reg(&self) -> &MerkleReg<Entry>
pub fn merkle_reg(&self) -> &MerkleReg<Entry>
Access the underlying MerkleReg (e.g. for access to history) NOTE: This API is unstable and may be removed in the future
Trait Implementations§
source§impl Clone for ClientRegister
impl Clone for ClientRegister
source§fn clone(&self) -> ClientRegister
fn clone(&self) -> ClientRegister
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for ClientRegister
impl RefUnwindSafe for ClientRegister
impl Send for ClientRegister
impl Sync for ClientRegister
impl Unpin for ClientRegister
impl UnwindSafe for ClientRegister
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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> 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<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<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>
fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>
source§fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>
fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>
source§fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>
fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>
source§fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>
fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>
source§fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>
fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>
source§fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>
fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>
source§fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>
fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>
source§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
source§fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>
fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>
source§fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>
fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>
source§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
source§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
source§fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
source§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
source§fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>
fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>
source§fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>
fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>
source§fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>
fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>
source§fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>
fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>
source§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
source§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
source§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
source§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
source§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
source§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
source§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
source§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
source§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
source§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
source§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
source§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
source§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
source§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
source§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
source§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
source§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
source§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
source§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
source§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
source§fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>
fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>
source§fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>
fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>
source§fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>
fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>
source§fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>
fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>
source§fn blink<'a>(&'a self) -> BlinkDisplay<'a, Self>
fn blink<'a>(&'a self) -> BlinkDisplay<'a, Self>
source§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
source§fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>
fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>
source§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, 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.