Struct penrose_ui::bar::schedule::UpdateSchedule
source · pub struct UpdateSchedule { /* private fields */ }
Expand description
For widgets that want to have their content updated periodically by the status bar by calling an external function.
See [IntervalText] for a simple implementation of this behaviour
Implementations§
source§impl UpdateSchedule
impl UpdateSchedule
sourcepub fn new(
interval: Duration,
get_text: Box<dyn Fn() -> Option<String> + Send + 'static>,
txt: Arc<Mutex<Text>>,
) -> Self
pub fn new( interval: Duration, get_text: Box<dyn Fn() -> Option<String> + Send + 'static>, txt: Arc<Mutex<Text>>, ) -> Self
Construct a new UpdateSchedule specifying the interval that the [Widget] content should be updated on and an update function for producing the widget content.
The updated content will then be stored in the provided Arc<Mutex<Text>>
for access
within your widget logic.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UpdateSchedule
impl !RefUnwindSafe for UpdateSchedule
impl Send for UpdateSchedule
impl !Sync for UpdateSchedule
impl Unpin for UpdateSchedule
impl !UnwindSafe for UpdateSchedule
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