#TryFromVal

2 messages · Page 1 of 1 (latest)

split field
#

Can anyone point me on how to implement this trait for a structure ?

Lets say I have the following structure and I need to implement this so that I can return it in a function :

struct User {
active: bool,
username: Symbol,
email: Symbol,
sign_in_count: u32,
}

stray phoenix
#

Add this attribute onto the struct:

#[soroban_sdk::contracttype]
struct User {
    ...