Warning, /sdk/rust-qt-binding-generator/tests/rust_objects/src/implementation.rs is written in an unsupported language. File is not indexed.

0001 #![allow(unused_imports)]
0002 #![allow(unused_variables)]
0003 #![allow(dead_code)]
0004 use interface::*;
0005 
0006 pub struct Group {
0007     emit: GroupEmitter,
0008     person: Person,
0009 }
0010 
0011 impl GroupTrait for Group {
0012     fn new(emit: GroupEmitter, person: Person) -> Group {
0013         Group {
0014             emit: emit,
0015             person: person,
0016         }
0017     }
0018     fn emit(&mut self) -> &mut GroupEmitter {
0019         &mut self.emit
0020     }
0021     fn person(&self) -> &Person {
0022         &self.person
0023     }
0024     fn person_mut(&mut self) -> &mut Person {
0025         &mut self.person
0026     }
0027 }
0028 
0029 pub struct InnerObject {
0030     emit: InnerObjectEmitter,
0031     description: String,
0032 }
0033 
0034 impl InnerObjectTrait for InnerObject {
0035     fn new(emit: InnerObjectEmitter) -> InnerObject {
0036         InnerObject {
0037             emit: emit,
0038             description: String::new(),
0039         }
0040     }
0041     fn emit(&mut self) -> &mut InnerObjectEmitter {
0042         &mut self.emit
0043     }
0044     fn description(&self) -> &str {
0045         &self.description
0046     }
0047     fn set_description(&mut self, value: String) {
0048         self.description = value;
0049         self.emit.description_changed();
0050     }
0051 }
0052 
0053 pub struct Person {
0054     emit: PersonEmitter,
0055     object: InnerObject,
0056 }
0057 
0058 impl PersonTrait for Person {
0059     fn new(emit: PersonEmitter, object: InnerObject) -> Person {
0060         Person {
0061             emit: emit,
0062             object: object,
0063         }
0064     }
0065     fn emit(&mut self) -> &mut PersonEmitter {
0066         &mut self.emit
0067     }
0068     fn object(&self) -> &InnerObject {
0069         &self.object
0070     }
0071     fn object_mut(&mut self) -> &mut InnerObject {
0072         &mut self.object
0073     }
0074 }
0075