new and getter
This commit is contained in:
12
src/lib.rs
12
src/lib.rs
@@ -1,4 +1,14 @@
|
||||
|
||||
pub struct StateOwner {
|
||||
pub state: String,
|
||||
state: String,
|
||||
}
|
||||
|
||||
impl StateOwner {
|
||||
pub fn new(state: String) -> StateOwner {
|
||||
StateOwner { state }
|
||||
}
|
||||
|
||||
pub fn get_state(&self) -> &str {
|
||||
&self.state
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user