-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65220e4
commit 8bd706f
Showing
14 changed files
with
207 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
// This is an experimental feature to generate Rust binding from Candid. | ||
// You may want to manually adjust some of the types. | ||
use candid::{self, CandidType, Deserialize, Principal}; | ||
#![allow(dead_code, unused_imports)] | ||
use candid::{self, CandidType, Deserialize, Principal, Encode, Decode}; | ||
use ic_cdk::api::call::CallResult as Result; | ||
|
||
#[derive(CandidType, Deserialize)] | ||
pub struct List(Option<(candid::Int,Box<List>,)>); | ||
|
||
pub struct SERVICE(pub Principal); | ||
impl SERVICE { | ||
pub struct Service(pub Principal); | ||
impl Service { | ||
pub async fn get(&self) -> Result<(List,)> { | ||
ic_cdk::call(self.0, "get", ()).await | ||
} | ||
pub async fn set(&self, arg0: List) -> Result<(List,)> { | ||
ic_cdk::call(self.0, "set", (arg0,)).await | ||
} | ||
} | ||
pub const service: SERVICE = SERVICE(Principal::from_slice(&[])); // aaaaa-aa | ||
pub const CANISTER_ID : Principal = Principal::from_slice(&[]); // aaaaa-aa | ||
pub const service : Service = Service(CANISTER_ID); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.