-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
2 changed files
with
66 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// the method will be renamed `retrieveCas` in the generated bindings | ||
#[wasm::export] | ||
pub fn retrieve_cas() { | ||
} | ||
|
||
// the method will be still called `update` in the generated bindings | ||
#[wasm::export] | ||
pub fn update() { | ||
} | ||
|
||
#[wasm::export] | ||
pub struct Session { | ||
instance_url: String, | ||
php_sess_id: String, | ||
} | ||
|
||
#[wasm::export] | ||
impl Session { | ||
#[wasm_bindgen(constructor)] | ||
pub fn new(instance_url: String, php_sess_id: String) -> Self { | ||
Self { | ||
instance_url, | ||
php_sess_id, | ||
} | ||
} | ||
|
||
#[wasm_bindgen(getter)] | ||
pub fn instance_url(&self) -> String { | ||
self.instance_url.clone() | ||
} | ||
|
||
#[wasm_bindgen(getter)] | ||
pub fn php_sess_id(&self) -> String { | ||
self.php_sess_id.clone() | ||
} | ||
} | ||
|
||
fn main() { | ||
println!("Hello, world!"); | ||
} |
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