Skip to content

Commit

Permalink
Improves formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
hydroid7 committed Dec 15, 2023
1 parent 2a60502 commit daa648a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 18 deletions.
12 changes: 5 additions & 7 deletions examples/examples/pretty_print.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@


use iceoryx2::service::{zero_copy, Service, service_name::ServiceName};

use iceoryx2::service::{service_name::ServiceName, zero_copy, Service};

fn main() {
let event_name = ServiceName::new("MyEventName").unwrap();
let event = zero_copy::Service::new(&event_name)
.event()
.open_or_create().unwrap();
.open_or_create()
.unwrap();

println!("{}", event);
}
println!("{}", event);
}
46 changes: 35 additions & 11 deletions iceoryx2/src/service/port_factory/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
//! # }
//! ```
use iceoryx2_cal::dynamic_storage::DynamicStorage;
use service::{zero_copy, process_local};
use service::{process_local, zero_copy};

use crate::service::{self, static_config};
use crate::service::{dynamic_config, ServiceName};
Expand Down Expand Up @@ -136,11 +136,23 @@ impl<'config> fmt::Display for PortFactory<'config, zero_copy::Service<'config>>
f.debug_struct("zero_copy::Service")
.field("name", &String::from(self.name().deref()))
.field("uuid", &self.uuid())
.field("max listeners", &self.static_config().max_supported_listeners())
.field("max notifiers", &self.static_config().max_supported_notifiers())
.field("active listeners", &self.dynamic_config().number_of_listeners())
.field("active notifiers", &self.dynamic_config().number_of_notifiers())
.finish()
.field(
"max listeners",
&self.static_config().max_supported_listeners(),
)
.field(
"max notifiers",
&self.static_config().max_supported_notifiers(),
)
.field(
"active listeners",
&self.dynamic_config().number_of_listeners(),
)
.field(
"active notifiers",
&self.dynamic_config().number_of_notifiers(),
)
.finish()
}
}

Expand All @@ -149,10 +161,22 @@ impl<'config> fmt::Display for PortFactory<'config, process_local::Service<'conf
f.debug_struct("process_local::Service")
.field("name", &String::from(self.name().deref()))
.field("uuid", &self.uuid())
.field("max listeners", &self.static_config().max_supported_listeners())
.field("max notifiers", &self.static_config().max_supported_notifiers())
.field("active listeners", &self.dynamic_config().number_of_listeners())
.field("active notifiers", &self.dynamic_config().number_of_notifiers())
.finish()
.field(
"max listeners",
&self.static_config().max_supported_listeners(),
)
.field(
"max notifiers",
&self.static_config().max_supported_notifiers(),
)
.field(
"active listeners",
&self.dynamic_config().number_of_listeners(),
)
.field(
"active notifiers",
&self.dynamic_config().number_of_notifiers(),
)
.finish()
}
}

0 comments on commit daa648a

Please sign in to comment.