Skip to content

Latest commit

 

History

History
157 lines (73 loc) · 5.38 KB

display.md

File metadata and controls

157 lines (73 loc) · 5.38 KB

Module 0x2::display

Resource Display

Display is used to define the display of the T

struct Display<T> has key

Struct DisplayCreate

Event when Display created

struct DisplayCreate<T> has copy, drop

Function resource_display

Create or borrow_mut Display object for resource T Only the module of T can call this function.

#[private_generics(#[T])]
public fun resource_display<T: key>(): &mut object::Object<display::Display<T>>

Function object_display

Create or borrow_mut Display object for Object<T> Only the module of T can call this function.

#[private_generics(#[T])]
public fun object_display<T: key>(): &mut object::Object<display::Display<object::Object<T>>>

Function set_value

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)

Function borrow_value

Function borrow_mut_value

Function remove_value

public fun remove_value<T>(self: &mut object::Object<display::Display<T>>, key: &string::String)

Function keys

Function values

Function contains_key

public fun contains_key<T>(self: &object::Object<display::Display<T>>, key: &string::String): bool