Skip to main content

DerivationStyle

Trait DerivationStyle 

Source
pub trait DerivationStyle:
    Copy
    + Eq
    + Hash
    + Default
    + Debug
    + Display
    + FromStr<Err = ParseDerivationStyleError>
    + 'static {
    // Required methods
    fn path(self, index: u32) -> String;
    fn name(self) -> &'static str;
    fn all() -> &'static [Self];
}
Expand description

Trait implemented by every chain’s DerivationStyle enum.

See the crate-level documentation for the full cross-chain contract.

Required Methods§

Source

fn path(self, index: u32) -> String

Build the BIP-32 / SLIP-10 derivation path for account index.

The returned String is owned because most call sites immediately feed it into a bip32 / slip10 parser that needs &str; the one-alloc-per-derivation cost is negligible against the secp256k1 / ed25519 key math that follows.

Source

fn name(self) -> &'static str

Human-readable name for CLI output and help text.

Kept stable across library versions so CLI users see identical strings after upgrades.

Source

fn all() -> &'static [Self]

Every variant of this enum in a 'static slice.

Powers CLI listing (kobe evm styles) and property tests that want to iterate over the whole style set without hand-maintaining a parallel list.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§