Skip to main content

Named

Trait Named 

Source
pub trait Named {
    // Required method
    fn named(name: &str) -> Self;
}
Expand description

Create deterministic test addresses from human-readable names.

use thruput_native_exec::test_helpers::Named;
use thruput_xdr::types::ContractAddress;

let alice = ContractAddress::named("alice");
assert_eq!(alice, ContractAddress::named("alice")); // deterministic
assert_ne!(alice, ContractAddress::named("bob"));   // distinct

Required Methods§

Source

fn named(name: &str) -> Self

The deterministic address derived from name.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Named for ContractAddress

Source§

fn named(name: &str) -> Self

Implementors§