- Resource
Display
- Struct
DisplayCreate
- Function
display
- Function
set_value
- Function
borrow_value
- Function
borrow_mut_value
- Function
remove_value
- Function
keys
- Function
values
- Function
contains_key
use 0x1::option;
use 0x1::string;
use 0x2::event;
use 0x2::object;
use 0x2::simple_map;
Display is used to define the display of the T
struct Display<T> has key
Event when Display created
struct DisplayCreate<T> has copy, drop
Create or borrow_mut Display object for T
Only the module of T
can call this function.
#[private_generics(#[T])]
public fun display<T: key>(): &mut object::Object<display::Display<T>>
Set the key-value pair for the display object If the key already exists, the value will be updated, otherwise a new key-value pair will be created.
public fun set_value<T>(self: &mut object::Object<display::Display<T>>, key: string::String, value: string::String)
public fun borrow_value<T>(self: &object::Object<display::Display<T>>, key: &string::String): &string::String
public fun borrow_mut_value<T>(self: &mut object::Object<display::Display<T>>, key: &string::String): &mut string::String
public fun remove_value<T>(self: &mut object::Object<display::Display<T>>, key: &string::String)
public fun keys<T>(self: &object::Object<display::Display<T>>): vector<string::String>
public fun values<T>(self: &object::Object<display::Display<T>>): vector<string::String>
public fun contains_key<T>(self: &object::Object<display::Display<T>>, key: &string::String): bool