aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordiogo464 <[email protected]>2025-12-05 00:32:51 +0000
committerdiogo464 <[email protected]>2025-12-05 00:32:51 +0000
commit89f230e2a6b4405432f913973b0768a4301cbc4d (patch)
tree1f1b88002ad5ac24b1558fb24c58ce74a8a51c6e /src
parent40a16d099c2bf2b3e5bf537aa14d37fdf9e52668 (diff)
added new publish functions to Entity
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 408dbb9..09ed555 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -401,6 +401,19 @@ impl<'a> Entity<'a> {
401 self.waker.wake(); 401 self.waker.wake();
402 } 402 }
403 403
404 pub fn publish_str(&mut self, payload: &str) {
405 self.publish(payload.as_bytes());
406 }
407
408 pub fn publish_display(&mut self, payload: &impl core::fmt::Display) {
409 use core::fmt::Write;
410
411 self.publish_with(|view| {
412 view.clear();
413 write!(view, "{}", payload).unwrap();
414 });
415 }
416
404 pub async fn wait_command(&mut self) { 417 pub async fn wait_command(&mut self) {
405 struct Fut<'a, 'b>(&'a mut Entity<'b>); 418 struct Fut<'a, 'b>(&'a mut Entity<'b>);
406 419