pub struct StructType { /* private fields */ }
Implementations§
Source§impl StructType
impl StructType
Sourcepub fn new(data: u32) -> StructType
pub fn new(data: u32) -> StructType
Examples found in repository?
examples/hello.rs (line 7)
6fn main() {
7 let instance = StructType::new(100);
8 assert_eq!(StructType::new(100), instance);
9 println!("{}", instance.get_data());
10
11 let instance = Box::new(StructType::new(101));
12 assert_eq!(Box::new(StructType::new(101)), instance);
13 println!("{}", instance.get_data());
14
15 let mut instance = StructType::new(102);
16 instance.set_data(&103);
17 assert_eq!(StructType::new(103), instance);
18 println!("{}", instance.get_data_for_all());
19
20 let mut instance = Box::new(StructType::new(104));
21 instance.set_data_for_all(&105);
22 assert_eq!(Box::new(StructType::new(105)), instance);
23 println!("{}", instance.get_data());
24
25 let instance :StructType = Default::default();
26 assert_eq!(StructType::new(0), instance);
27 println!("{}", instance.get_data());
28}
Sourcepub fn get_data_for_all(&self) -> u32
pub fn get_data_for_all(&self) -> u32
Examples found in repository?
examples/hello.rs (line 18)
6fn main() {
7 let instance = StructType::new(100);
8 assert_eq!(StructType::new(100), instance);
9 println!("{}", instance.get_data());
10
11 let instance = Box::new(StructType::new(101));
12 assert_eq!(Box::new(StructType::new(101)), instance);
13 println!("{}", instance.get_data());
14
15 let mut instance = StructType::new(102);
16 instance.set_data(&103);
17 assert_eq!(StructType::new(103), instance);
18 println!("{}", instance.get_data_for_all());
19
20 let mut instance = Box::new(StructType::new(104));
21 instance.set_data_for_all(&105);
22 assert_eq!(Box::new(StructType::new(105)), instance);
23 println!("{}", instance.get_data());
24
25 let instance :StructType = Default::default();
26 assert_eq!(StructType::new(0), instance);
27 println!("{}", instance.get_data());
28}
Sourcepub fn set_data_for_all(&mut self, data: &u32)
pub fn set_data_for_all(&mut self, data: &u32)
Examples found in repository?
examples/hello.rs (line 21)
6fn main() {
7 let instance = StructType::new(100);
8 assert_eq!(StructType::new(100), instance);
9 println!("{}", instance.get_data());
10
11 let instance = Box::new(StructType::new(101));
12 assert_eq!(Box::new(StructType::new(101)), instance);
13 println!("{}", instance.get_data());
14
15 let mut instance = StructType::new(102);
16 instance.set_data(&103);
17 assert_eq!(StructType::new(103), instance);
18 println!("{}", instance.get_data_for_all());
19
20 let mut instance = Box::new(StructType::new(104));
21 instance.set_data_for_all(&105);
22 assert_eq!(Box::new(StructType::new(105)), instance);
23 println!("{}", instance.get_data());
24
25 let instance :StructType = Default::default();
26 assert_eq!(StructType::new(0), instance);
27 println!("{}", instance.get_data());
28}
Trait Implementations§
Source§impl Debug for StructType
impl Debug for StructType
Source§impl Default for StructType
impl Default for StructType
Source§fn default() -> StructType
fn default() -> StructType
Returns the “default value” for a type. Read more
Source§impl PartialEq for StructType
impl PartialEq for StructType
Source§impl TraitCanal for StructType
impl TraitCanal for StructType
Source§impl TraitKanal for StructType
impl TraitKanal for StructType
impl StructuralPartialEq for StructType
Auto Trait Implementations§
impl Freeze for StructType
impl RefUnwindSafe for StructType
impl Send for StructType
impl Sync for StructType
impl Unpin for StructType
impl UnwindSafe for StructType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more