Module 0x2::config
- Resource
Config
- Struct
Setting
- Struct
SettingData
- Constants
- Function
new
- Function
share
- Function
transfer
- Function
add_for_next_epoch
- Function
remove_for_next_epoch
- Function
exists_with_type
- Function
exists_with_type_for_next_epoch
- Function
borrow_for_next_epoch_mut
- Function
read_setting_for_next_epoch
- Function
read_setting
- Function
read_setting_impl
use 0x1::option;
use 0x2::dynamic_field;
use 0x2::object;
use 0x2::transfer;
use 0x2::tx_context;
Resource Config
struct Config<WriteCap> has key
Click to open
Fields
Struct Setting
struct Setting<Value: copy, drop, store> has drop, store
Click to open
Fields
Struct SettingData
struct SettingData<Value: copy, drop, store> has drop, store
Click to open
Fields
Constants
const EBCSSerializationFailure: u64 = 2;
const EAlreadySetForEpoch: u64 = 0;
const ENotSetForEpoch: u64 = 1;
Function new
public(friend) fun new<WriteCap>(_cap: &mut WriteCap, ctx: &mut tx_context::TxContext): config::Config<WriteCap>
Click to open
Implementation
Function share
public(friend) fun share<WriteCap>(config: config::Config<WriteCap>)
Click to open
Implementation
Function transfer
public(friend) fun transfer<WriteCap>(config: config::Config<WriteCap>, owner: address)
Click to open
Implementation
Function add_for_next_epoch
public(friend) fun add_for_next_epoch<WriteCap, Name: copy, drop, store, Value: copy, drop, store>(config: &mut config::Config<WriteCap>, _cap: &mut WriteCap, name: Name, value: Value, ctx: &mut tx_context::TxContext): option::Option<Value>
Click to open
Implementation
Function remove_for_next_epoch
public(friend) fun remove_for_next_epoch<WriteCap, Name: copy, drop, store, Value: copy, drop, store>(config: &mut config::Config<WriteCap>, _cap: &mut WriteCap, name: Name, ctx: &mut tx_context::TxContext): option::Option<Value>
Click to open
Implementation
Function exists_with_type
public(friend) fun exists_with_type<WriteCap, Name: copy, drop, store, Value: copy, drop, store>(config: &config::Config<WriteCap>, name: Name): bool
Click to open
Implementation
Function exists_with_type_for_next_epoch
public(friend) fun exists_with_type_for_next_epoch<WriteCap, Name: copy, drop, store, Value: copy, drop, store>(config: &config::Config<WriteCap>, name: Name, ctx: &tx_context::TxContext): bool
Click to open
Implementation
Function borrow_for_next_epoch_mut
public(friend) fun borrow_for_next_epoch_mut<WriteCap, Name: copy, drop, store, Value: copy, drop, store>(config: &mut config::Config<WriteCap>, _cap: &mut WriteCap, name: Name, ctx: &mut tx_context::TxContext): &mut Value
Click to open
Implementation
Function read_setting_for_next_epoch
public(friend) fun read_setting_for_next_epoch<WriteCap, Name: copy, drop, store, Value: copy, drop, store>(config: &config::Config<WriteCap>, name: Name): option::Option<Value>
Click to open
Implementation
Function read_setting
public(friend) fun read_setting<Name: copy, drop, store, Value: copy, drop, store>(config: object::ID, name: Name, ctx: &tx_context::TxContext): option::Option<Value>
Click to open
Implementation
Function read_setting_impl
fun read_setting_impl<FieldSettingValue: key, SettingValue: store, SettingDataValue: store, Value: copy, drop, store>(config: address, name: address, current_epoch: u64): option::Option<Value>
Click to open