Pass the emitter as mutable. It is pointless otherwise.
parent
fa337c37b1
commit
385ae17bb7
|
@ -44,8 +44,8 @@ impl DemoTrait for Demo {
|
||||||
time_series
|
time_series
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn emit(&self) -> &DemoEmitter {
|
fn emit(&mut self) -> &mut DemoEmitter {
|
||||||
&self.emit
|
&mut self.emit
|
||||||
}
|
}
|
||||||
fn fibonacci(&self) -> &Fibonacci {
|
fn fibonacci(&self) -> &Fibonacci {
|
||||||
&self.fibonacci
|
&self.fibonacci
|
||||||
|
|
|
@ -53,8 +53,8 @@ impl FibonacciTrait for Fibonacci {
|
||||||
result: Arc::new(AtomicUsize::new(0)),
|
result: Arc::new(AtomicUsize::new(0)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn emit(&self) -> &FibonacciEmitter {
|
fn emit(&mut self) -> &mut FibonacciEmitter {
|
||||||
&self.emit
|
&mut self.emit
|
||||||
}
|
}
|
||||||
fn input(&self) -> u32 {
|
fn input(&self) -> u32 {
|
||||||
self.input
|
self.input
|
||||||
|
@ -87,8 +87,8 @@ impl FibonacciListTrait for FibonacciList {
|
||||||
emit,
|
emit,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn emit(&self) -> &FibonacciListEmitter {
|
fn emit(&mut self) -> &mut FibonacciListEmitter {
|
||||||
&self.emit
|
&mut self.emit
|
||||||
}
|
}
|
||||||
fn row_count(&self) -> usize {
|
fn row_count(&self) -> usize {
|
||||||
93
|
93
|
||||||
|
|
|
@ -228,8 +228,8 @@ where
|
||||||
tree.reset();
|
tree.reset();
|
||||||
tree
|
tree
|
||||||
}
|
}
|
||||||
fn emit(&self) -> &FileSystemTreeEmitter {
|
fn emit(&mut self) -> &mut FileSystemTreeEmitter {
|
||||||
&self.emit
|
&mut self.emit
|
||||||
}
|
}
|
||||||
fn path(&self) -> Option<&str> {
|
fn path(&self) -> Option<&str> {
|
||||||
self.path.as_ref().map(|s| &s[..])
|
self.path.as_ref().map(|s| &s[..])
|
||||||
|
|
|
@ -89,8 +89,12 @@ fn handle_tasks(processes: &mut HashMap<pid_t, ProcessItem>) -> Vec<pid_t> {
|
||||||
let pids: Vec<pid_t> = processes.keys().cloned().collect();
|
let pids: Vec<pid_t> = processes.keys().cloned().collect();
|
||||||
for pid in pids {
|
for pid in pids {
|
||||||
if let Some(parent) = processes[&pid].process.parent {
|
if let Some(parent) = processes[&pid].process.parent {
|
||||||
let p = processes.get_mut(&parent).unwrap();
|
if let Some(p) = processes.get_mut(&parent) {
|
||||||
p.tasks.push(pid);
|
p.tasks.push(pid);
|
||||||
|
} else {
|
||||||
|
println!("no parent for {}", pid);
|
||||||
|
top.push(pid);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
top.push(pid);
|
top.push(pid);
|
||||||
}
|
}
|
||||||
|
@ -334,8 +338,8 @@ impl ProcessesTrait for Processes {
|
||||||
update_thread(emit, p.incoming.clone(), p.active, rx);
|
update_thread(emit, p.incoming.clone(), p.active, rx);
|
||||||
p
|
p
|
||||||
}
|
}
|
||||||
fn emit(&self) -> &ProcessesEmitter {
|
fn emit(&mut self) -> &mut ProcessesEmitter {
|
||||||
&self.emit
|
&mut self.emit
|
||||||
}
|
}
|
||||||
fn row_count(&self, index: Option<usize>) -> usize {
|
fn row_count(&self, index: Option<usize>) -> usize {
|
||||||
if let Some(index) = index {
|
if let Some(index) = index {
|
||||||
|
|
|
@ -46,8 +46,8 @@ impl TimeSeriesTrait for TimeSeries {
|
||||||
}
|
}
|
||||||
series
|
series
|
||||||
}
|
}
|
||||||
fn emit(&self) -> &TimeSeriesEmitter {
|
fn emit(&mut self) -> &mut TimeSeriesEmitter {
|
||||||
&self.emit
|
&mut self.emit
|
||||||
}
|
}
|
||||||
fn row_count(&self) -> usize {
|
fn row_count(&self) -> usize {
|
||||||
self.list.len() as usize
|
self.list.len() as usize
|
||||||
|
|
|
@ -125,7 +125,7 @@ pub trait DemoTrait {
|
||||||
file_system_tree: FileSystemTree,
|
file_system_tree: FileSystemTree,
|
||||||
processes: Processes,
|
processes: Processes,
|
||||||
time_series: TimeSeries) -> Self;
|
time_series: TimeSeries) -> Self;
|
||||||
fn emit(&self) -> &DemoEmitter;
|
fn emit(&mut self) -> &mut DemoEmitter;
|
||||||
fn fibonacci(&self) -> &Fibonacci;
|
fn fibonacci(&self) -> &Fibonacci;
|
||||||
fn fibonacci_mut(&mut self) -> &mut Fibonacci;
|
fn fibonacci_mut(&mut self) -> &mut Fibonacci;
|
||||||
fn fibonacci_list(&self) -> &FibonacciList;
|
fn fibonacci_list(&self) -> &FibonacciList;
|
||||||
|
@ -369,7 +369,7 @@ impl FibonacciEmitter {
|
||||||
|
|
||||||
pub trait FibonacciTrait {
|
pub trait FibonacciTrait {
|
||||||
fn new(emit: FibonacciEmitter) -> Self;
|
fn new(emit: FibonacciEmitter) -> Self;
|
||||||
fn emit(&self) -> &FibonacciEmitter;
|
fn emit(&mut self) -> &mut FibonacciEmitter;
|
||||||
fn input(&self) -> u32;
|
fn input(&self) -> u32;
|
||||||
fn set_input(&mut self, value: u32);
|
fn set_input(&mut self, value: u32);
|
||||||
fn result(&self) -> u64;
|
fn result(&self) -> u64;
|
||||||
|
@ -498,7 +498,7 @@ impl FibonacciListList {
|
||||||
|
|
||||||
pub trait FibonacciListTrait {
|
pub trait FibonacciListTrait {
|
||||||
fn new(emit: FibonacciListEmitter, model: FibonacciListList) -> Self;
|
fn new(emit: FibonacciListEmitter, model: FibonacciListList) -> Self;
|
||||||
fn emit(&self) -> &FibonacciListEmitter;
|
fn emit(&mut self) -> &mut FibonacciListEmitter;
|
||||||
fn row_count(&self) -> usize;
|
fn row_count(&self) -> usize;
|
||||||
fn insert_rows(&mut self, _row: usize, _count: usize) -> bool { false }
|
fn insert_rows(&mut self, _row: usize, _count: usize) -> bool { false }
|
||||||
fn remove_rows(&mut self, _row: usize, _count: usize) -> bool { false }
|
fn remove_rows(&mut self, _row: usize, _count: usize) -> bool { false }
|
||||||
|
@ -691,7 +691,7 @@ impl FileSystemTreeTree {
|
||||||
|
|
||||||
pub trait FileSystemTreeTrait {
|
pub trait FileSystemTreeTrait {
|
||||||
fn new(emit: FileSystemTreeEmitter, model: FileSystemTreeTree) -> Self;
|
fn new(emit: FileSystemTreeEmitter, model: FileSystemTreeTree) -> Self;
|
||||||
fn emit(&self) -> &FileSystemTreeEmitter;
|
fn emit(&mut self) -> &mut FileSystemTreeEmitter;
|
||||||
fn path(&self) -> Option<&str>;
|
fn path(&self) -> Option<&str>;
|
||||||
fn set_path(&mut self, value: Option<String>);
|
fn set_path(&mut self, value: Option<String>);
|
||||||
fn row_count(&self, Option<usize>) -> usize;
|
fn row_count(&self, Option<usize>) -> usize;
|
||||||
|
@ -998,7 +998,7 @@ impl ProcessesTree {
|
||||||
|
|
||||||
pub trait ProcessesTrait {
|
pub trait ProcessesTrait {
|
||||||
fn new(emit: ProcessesEmitter, model: ProcessesTree) -> Self;
|
fn new(emit: ProcessesEmitter, model: ProcessesTree) -> Self;
|
||||||
fn emit(&self) -> &ProcessesEmitter;
|
fn emit(&mut self) -> &mut ProcessesEmitter;
|
||||||
fn active(&self) -> bool;
|
fn active(&self) -> bool;
|
||||||
fn set_active(&mut self, value: bool);
|
fn set_active(&mut self, value: bool);
|
||||||
fn row_count(&self, Option<usize>) -> usize;
|
fn row_count(&self, Option<usize>) -> usize;
|
||||||
|
@ -1278,7 +1278,7 @@ impl TimeSeriesList {
|
||||||
|
|
||||||
pub trait TimeSeriesTrait {
|
pub trait TimeSeriesTrait {
|
||||||
fn new(emit: TimeSeriesEmitter, model: TimeSeriesList) -> Self;
|
fn new(emit: TimeSeriesEmitter, model: TimeSeriesList) -> Self;
|
||||||
fn emit(&self) -> &TimeSeriesEmitter;
|
fn emit(&mut self) -> &mut TimeSeriesEmitter;
|
||||||
fn row_count(&self) -> usize;
|
fn row_count(&self) -> usize;
|
||||||
fn insert_rows(&mut self, _row: usize, _count: usize) -> bool { false }
|
fn insert_rows(&mut self, _row: usize, _count: usize) -> bool { false }
|
||||||
fn remove_rows(&mut self, _row: usize, _count: usize) -> bool { false }
|
fn remove_rows(&mut self, _row: usize, _count: usize) -> bool { false }
|
||||||
|
|
|
@ -32,8 +32,8 @@ impl TodosTrait for Todos {
|
||||||
active_count: 0,
|
active_count: 0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn emit(&self) -> &TodosEmitter {
|
fn emit(&mut self) -> &mut TodosEmitter {
|
||||||
&self.emit
|
&mut self.emit
|
||||||
}
|
}
|
||||||
fn active_count(&self) -> u64 {
|
fn active_count(&self) -> u64 {
|
||||||
self.active_count as u64
|
self.active_count as u64
|
||||||
|
|
|
@ -193,7 +193,7 @@ impl TodosList {
|
||||||
|
|
||||||
pub trait TodosTrait {
|
pub trait TodosTrait {
|
||||||
fn new(emit: TodosEmitter, model: TodosList) -> Self;
|
fn new(emit: TodosEmitter, model: TodosList) -> Self;
|
||||||
fn emit(&self) -> &TodosEmitter;
|
fn emit(&mut self) -> &mut TodosEmitter;
|
||||||
fn active_count(&self) -> u64;
|
fn active_count(&self) -> u64;
|
||||||
fn count(&self) -> u64;
|
fn count(&self) -> u64;
|
||||||
fn add(&mut self, description: String) -> ();
|
fn add(&mut self, description: String) -> ();
|
||||||
|
|
|
@ -492,7 +492,7 @@ pub trait {}Trait {{
|
||||||
writeln!(
|
writeln!(
|
||||||
r,
|
r,
|
||||||
") -> Self;
|
") -> Self;
|
||||||
fn emit(&self) -> &{}Emitter;",
|
fn emit(&mut self) -> &mut {}Emitter;",
|
||||||
o.name
|
o.name
|
||||||
)?;
|
)?;
|
||||||
for (name, p) in &o.properties {
|
for (name, p) in &o.properties {
|
||||||
|
@ -1347,7 +1347,7 @@ fn write_rust_implementation_object(r: &mut Vec<u8>, o: &Object) -> Result<()> {
|
||||||
r,
|
r,
|
||||||
" }}
|
" }}
|
||||||
}}
|
}}
|
||||||
fn emit(&self) -> &{}Emitter {{
|
fn emit(&mut self) -> &mut {}Emitter {{
|
||||||
&self.emit
|
&self.emit
|
||||||
}}",
|
}}",
|
||||||
o.name
|
o.name
|
||||||
|
|
|
@ -12,8 +12,8 @@ impl SimpleTrait for Simple {
|
||||||
message: String::new(),
|
message: String::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn emit(&self) -> &SimpleEmitter {
|
fn emit(&mut self) -> &mut SimpleEmitter {
|
||||||
&self.emit
|
&mut self.emit
|
||||||
}
|
}
|
||||||
fn message(&self) -> &str {
|
fn message(&self) -> &str {
|
||||||
"Hello World!"
|
"Hello World!"
|
||||||
|
|
|
@ -74,7 +74,7 @@ impl SimpleEmitter {
|
||||||
|
|
||||||
pub trait SimpleTrait {
|
pub trait SimpleTrait {
|
||||||
fn new(emit: SimpleEmitter) -> Self;
|
fn new(emit: SimpleEmitter) -> Self;
|
||||||
fn emit(&self) -> &SimpleEmitter;
|
fn emit(&mut self) -> &mut SimpleEmitter;
|
||||||
fn message(&self) -> &str;
|
fn message(&self) -> &str;
|
||||||
fn set_message(&mut self, value: String);
|
fn set_message(&mut self, value: String);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,8 @@ impl SimpleTrait for Simple {
|
||||||
message: String::new(),
|
message: String::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn emit(&self) -> &SimpleEmitter {
|
fn emit(&mut self) -> &mut SimpleEmitter {
|
||||||
&self.emit
|
&mut self.emit
|
||||||
}
|
}
|
||||||
fn message(&self) -> &str {
|
fn message(&self) -> &str {
|
||||||
"Hello World!"
|
"Hello World!"
|
||||||
|
|
|
@ -74,7 +74,7 @@ impl SimpleEmitter {
|
||||||
|
|
||||||
pub trait SimpleTrait {
|
pub trait SimpleTrait {
|
||||||
fn new(emit: SimpleEmitter) -> Self;
|
fn new(emit: SimpleEmitter) -> Self;
|
||||||
fn emit(&self) -> &SimpleEmitter;
|
fn emit(&mut self) -> &mut SimpleEmitter;
|
||||||
fn message(&self) -> &str;
|
fn message(&self) -> &str;
|
||||||
fn set_message(&mut self, value: String);
|
fn set_message(&mut self, value: String);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,8 +15,8 @@ impl PersonTrait for Person {
|
||||||
user_name: String::new(),
|
user_name: String::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn emit(&self) -> &PersonEmitter {
|
fn emit(&mut self) -> &mut PersonEmitter {
|
||||||
&self.emit
|
&mut self.emit
|
||||||
}
|
}
|
||||||
fn user_name(&self) -> &str {
|
fn user_name(&self) -> &str {
|
||||||
&self.user_name
|
&self.user_name
|
||||||
|
|
|
@ -77,7 +77,7 @@ impl PersonEmitter {
|
||||||
|
|
||||||
pub trait PersonTrait {
|
pub trait PersonTrait {
|
||||||
fn new(emit: PersonEmitter) -> Self;
|
fn new(emit: PersonEmitter) -> Self;
|
||||||
fn emit(&self) -> &PersonEmitter;
|
fn emit(&mut self) -> &mut PersonEmitter;
|
||||||
fn user_name(&self) -> &str;
|
fn user_name(&self) -> &str;
|
||||||
fn set_user_name(&mut self, value: String);
|
fn set_user_name(&mut self, value: String);
|
||||||
fn append(&mut self, suffix: String, amount: u32) -> ();
|
fn append(&mut self, suffix: String, amount: u32) -> ();
|
||||||
|
|
|
@ -23,8 +23,8 @@ impl PersonsTrait for Persons {
|
||||||
list: vec![PersonsItem::default(); 10],
|
list: vec![PersonsItem::default(); 10],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn emit(&self) -> &PersonsEmitter {
|
fn emit(&mut self) -> &mut PersonsEmitter {
|
||||||
&self.emit
|
&mut self.emit
|
||||||
}
|
}
|
||||||
fn row_count(&self) -> usize {
|
fn row_count(&self) -> usize {
|
||||||
self.list.len()
|
self.list.len()
|
||||||
|
@ -52,8 +52,8 @@ impl NoRoleTrait for NoRole {
|
||||||
list: vec![PersonsItem::default(); 10],
|
list: vec![PersonsItem::default(); 10],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn emit(&self) -> &NoRoleEmitter {
|
fn emit(&mut self) -> &mut NoRoleEmitter {
|
||||||
&self.emit
|
&mut self.emit
|
||||||
}
|
}
|
||||||
fn row_count(&self) -> usize {
|
fn row_count(&self) -> usize {
|
||||||
self.list.len()
|
self.list.len()
|
||||||
|
|
|
@ -177,7 +177,7 @@ impl NoRoleList {
|
||||||
|
|
||||||
pub trait NoRoleTrait {
|
pub trait NoRoleTrait {
|
||||||
fn new(emit: NoRoleEmitter, model: NoRoleList) -> Self;
|
fn new(emit: NoRoleEmitter, model: NoRoleList) -> Self;
|
||||||
fn emit(&self) -> &NoRoleEmitter;
|
fn emit(&mut self) -> &mut NoRoleEmitter;
|
||||||
fn row_count(&self) -> usize;
|
fn row_count(&self) -> usize;
|
||||||
fn insert_rows(&mut self, _row: usize, _count: usize) -> bool { false }
|
fn insert_rows(&mut self, _row: usize, _count: usize) -> bool { false }
|
||||||
fn remove_rows(&mut self, _row: usize, _count: usize) -> bool { false }
|
fn remove_rows(&mut self, _row: usize, _count: usize) -> bool { false }
|
||||||
|
@ -389,7 +389,7 @@ impl PersonsList {
|
||||||
|
|
||||||
pub trait PersonsTrait {
|
pub trait PersonsTrait {
|
||||||
fn new(emit: PersonsEmitter, model: PersonsList) -> Self;
|
fn new(emit: PersonsEmitter, model: PersonsList) -> Self;
|
||||||
fn emit(&self) -> &PersonsEmitter;
|
fn emit(&mut self) -> &mut PersonsEmitter;
|
||||||
fn row_count(&self) -> usize;
|
fn row_count(&self) -> usize;
|
||||||
fn insert_rows(&mut self, _row: usize, _count: usize) -> bool { false }
|
fn insert_rows(&mut self, _row: usize, _count: usize) -> bool { false }
|
||||||
fn remove_rows(&mut self, _row: usize, _count: usize) -> bool { false }
|
fn remove_rows(&mut self, _row: usize, _count: usize) -> bool { false }
|
||||||
|
|
|
@ -37,8 +37,8 @@ impl ListTrait for List {
|
||||||
list: vec![ListItem::default(); 10],
|
list: vec![ListItem::default(); 10],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn emit(&self) -> &ListEmitter {
|
fn emit(&mut self) -> &mut ListEmitter {
|
||||||
&self.emit
|
&mut self.emit
|
||||||
}
|
}
|
||||||
fn row_count(&self) -> usize {
|
fn row_count(&self) -> usize {
|
||||||
self.list.len()
|
self.list.len()
|
||||||
|
|
|
@ -180,7 +180,7 @@ impl ListList {
|
||||||
|
|
||||||
pub trait ListTrait {
|
pub trait ListTrait {
|
||||||
fn new(emit: ListEmitter, model: ListList) -> Self;
|
fn new(emit: ListEmitter, model: ListList) -> Self;
|
||||||
fn emit(&self) -> &ListEmitter;
|
fn emit(&mut self) -> &mut ListEmitter;
|
||||||
fn row_count(&self) -> usize;
|
fn row_count(&self) -> usize;
|
||||||
fn insert_rows(&mut self, _row: usize, _count: usize) -> bool { false }
|
fn insert_rows(&mut self, _row: usize, _count: usize) -> bool { false }
|
||||||
fn remove_rows(&mut self, _row: usize, _count: usize) -> bool { false }
|
fn remove_rows(&mut self, _row: usize, _count: usize) -> bool { false }
|
||||||
|
|
|
@ -15,8 +15,8 @@ impl PersonTrait for Person {
|
||||||
user_name: String::new(),
|
user_name: String::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn emit(&self) -> &PersonEmitter {
|
fn emit(&mut self) -> &mut PersonEmitter {
|
||||||
&self.emit
|
&mut self.emit
|
||||||
}
|
}
|
||||||
fn user_name(&self) -> &str {
|
fn user_name(&self) -> &str {
|
||||||
&self.user_name
|
&self.user_name
|
||||||
|
|
|
@ -74,7 +74,7 @@ impl PersonEmitter {
|
||||||
|
|
||||||
pub trait PersonTrait {
|
pub trait PersonTrait {
|
||||||
fn new(emit: PersonEmitter) -> Self;
|
fn new(emit: PersonEmitter) -> Self;
|
||||||
fn emit(&self) -> &PersonEmitter;
|
fn emit(&mut self) -> &mut PersonEmitter;
|
||||||
fn user_name(&self) -> &str;
|
fn user_name(&self) -> &str;
|
||||||
fn set_user_name(&mut self, value: String);
|
fn set_user_name(&mut self, value: String);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,8 +49,8 @@ impl ObjectTrait for Object {
|
||||||
string_by_function: String::new()
|
string_by_function: String::new()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn emit(&self) -> &ObjectEmitter {
|
fn emit(&mut self) -> &mut ObjectEmitter {
|
||||||
&self.emit
|
&mut self.emit
|
||||||
}
|
}
|
||||||
fn boolean(&self) -> bool {
|
fn boolean(&self) -> bool {
|
||||||
self.boolean
|
self.boolean
|
||||||
|
|
|
@ -250,7 +250,7 @@ impl ObjectEmitter {
|
||||||
|
|
||||||
pub trait ObjectTrait {
|
pub trait ObjectTrait {
|
||||||
fn new(emit: ObjectEmitter) -> Self;
|
fn new(emit: ObjectEmitter) -> Self;
|
||||||
fn emit(&self) -> &ObjectEmitter;
|
fn emit(&mut self) -> &mut ObjectEmitter;
|
||||||
fn boolean(&self) -> bool;
|
fn boolean(&self) -> bool;
|
||||||
fn set_boolean(&mut self, value: bool);
|
fn set_boolean(&mut self, value: bool);
|
||||||
fn bytearray(&self) -> &[u8];
|
fn bytearray(&self) -> &[u8];
|
||||||
|
|
|
@ -15,8 +15,8 @@ impl GroupTrait for Group {
|
||||||
person: person,
|
person: person,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn emit(&self) -> &GroupEmitter {
|
fn emit(&mut self) -> &mut GroupEmitter {
|
||||||
&self.emit
|
&mut self.emit
|
||||||
}
|
}
|
||||||
fn person(&self) -> &Person {
|
fn person(&self) -> &Person {
|
||||||
&self.person
|
&self.person
|
||||||
|
@ -38,8 +38,8 @@ impl InnerObjectTrait for InnerObject {
|
||||||
description: String::new(),
|
description: String::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn emit(&self) -> &InnerObjectEmitter {
|
fn emit(&mut self) -> &mut InnerObjectEmitter {
|
||||||
&self.emit
|
&mut self.emit
|
||||||
}
|
}
|
||||||
fn description(&self) -> &str {
|
fn description(&self) -> &str {
|
||||||
&self.description
|
&self.description
|
||||||
|
@ -62,8 +62,8 @@ impl PersonTrait for Person {
|
||||||
object: object,
|
object: object,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn emit(&self) -> &PersonEmitter {
|
fn emit(&mut self) -> &mut PersonEmitter {
|
||||||
&self.emit
|
&mut self.emit
|
||||||
}
|
}
|
||||||
fn object(&self) -> &InnerObject {
|
fn object(&self) -> &InnerObject {
|
||||||
&self.object
|
&self.object
|
||||||
|
|
|
@ -67,7 +67,7 @@ impl GroupEmitter {
|
||||||
pub trait GroupTrait {
|
pub trait GroupTrait {
|
||||||
fn new(emit: GroupEmitter,
|
fn new(emit: GroupEmitter,
|
||||||
person: Person) -> Self;
|
person: Person) -> Self;
|
||||||
fn emit(&self) -> &GroupEmitter;
|
fn emit(&mut self) -> &mut GroupEmitter;
|
||||||
fn person(&self) -> &Person;
|
fn person(&self) -> &Person;
|
||||||
fn person_mut(&mut self) -> &mut Person;
|
fn person_mut(&mut self) -> &mut Person;
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ impl InnerObjectEmitter {
|
||||||
|
|
||||||
pub trait InnerObjectTrait {
|
pub trait InnerObjectTrait {
|
||||||
fn new(emit: InnerObjectEmitter) -> Self;
|
fn new(emit: InnerObjectEmitter) -> Self;
|
||||||
fn emit(&self) -> &InnerObjectEmitter;
|
fn emit(&mut self) -> &mut InnerObjectEmitter;
|
||||||
fn description(&self) -> &str;
|
fn description(&self) -> &str;
|
||||||
fn set_description(&mut self, value: String);
|
fn set_description(&mut self, value: String);
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ impl PersonEmitter {
|
||||||
pub trait PersonTrait {
|
pub trait PersonTrait {
|
||||||
fn new(emit: PersonEmitter,
|
fn new(emit: PersonEmitter,
|
||||||
object: InnerObject) -> Self;
|
object: InnerObject) -> Self;
|
||||||
fn emit(&self) -> &PersonEmitter;
|
fn emit(&mut self) -> &mut PersonEmitter;
|
||||||
fn object(&self) -> &InnerObject;
|
fn object(&self) -> &InnerObject;
|
||||||
fn object_mut(&mut self) -> &mut InnerObject;
|
fn object_mut(&mut self) -> &mut InnerObject;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,8 @@ impl PersonsTrait for Persons {
|
||||||
list: vec![PersonsItem::default(); 10],
|
list: vec![PersonsItem::default(); 10],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn emit(&self) -> &PersonsEmitter {
|
fn emit(&mut self) -> &mut PersonsEmitter {
|
||||||
&self.emit
|
&mut self.emit
|
||||||
}
|
}
|
||||||
fn row_count(&self, index: Option<usize>) -> usize {
|
fn row_count(&self, index: Option<usize>) -> usize {
|
||||||
self.list.len()
|
self.list.len()
|
||||||
|
|
|
@ -177,7 +177,7 @@ impl PersonsTree {
|
||||||
|
|
||||||
pub trait PersonsTrait {
|
pub trait PersonsTrait {
|
||||||
fn new(emit: PersonsEmitter, model: PersonsTree) -> Self;
|
fn new(emit: PersonsEmitter, model: PersonsTree) -> Self;
|
||||||
fn emit(&self) -> &PersonsEmitter;
|
fn emit(&mut self) -> &mut PersonsEmitter;
|
||||||
fn row_count(&self, Option<usize>) -> usize;
|
fn row_count(&self, Option<usize>) -> usize;
|
||||||
fn can_fetch_more(&self, Option<usize>) -> bool {
|
fn can_fetch_more(&self, Option<usize>) -> bool {
|
||||||
false
|
false
|
||||||
|
|
Loading…
Reference in New Issue