Skip to main content

options/
token.rs

1use crate::Value;
2use tokens::ChangeToken;
3
4/// Used to fetch a [change token](ChangeToken) to track options changes.
5#[cfg_attr(feature = "async", maybe_impl::traits(Send, Sync))]
6pub trait ChangeTokenSource<T: Value> {
7    /// Creates and returns a [change token](ChangeToken) which can be used to register a change notification callback.
8    fn token(&self) -> Box<dyn ChangeToken>;
9
10    /// Gets the name of the option instance being changed, if any.
11    fn name(&self) -> &str {
12        ""
13    }
14}