Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created May 20, 2022 10:12
Show Gist options
  • Save rust-play/102db6e32a608b0f6250d2bbd417e038 to your computer and use it in GitHub Desktop.
Save rust-play/102db6e32a608b0f6250d2bbd417e038 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
...
#[derive(Serialize, Deserialize)]
pub enum Msg {
Hello,
Greet { name: String },
}
[entry_point]
pub fn execute(
deps: DepsMut,
_env: Env,
_info: MessageInfo,
msg: Msg,
) -> Result<Response, ContractError> {
match msg {
Msg::Hello => println!("hello world!"),
Msg::Greet { name } => println!("hello, {}", &name),
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment