pub struct ConfigVar<T>(pub ReadVar<T>);Expand description
A wrapper around ReadVar<T> that implements PartialEq via
backing-variable identity (VarEqBacking).
Use this in config structs where a ReadVar field needs equality
comparison for config merging. Since ReadVar deliberately does not
implement PartialEq (its values aren’t known at flow-resolution time),
ConfigVar provides identity-based comparison instead.
§Example
ⓘ
flowey_config! {
pub struct Config {
pub verbose: Option<ConfigVar<bool>>,
}
}Tuple Fields§
§0: ReadVar<T>Trait Implementations§
Source§impl<T: Serialize + DeserializeOwned + PartialEq + Eq + Clone> ClaimVar for ConfigVar<T>
impl<T: Serialize + DeserializeOwned + PartialEq + Eq + Clone> ClaimVar for ConfigVar<T>
Source§type Claimed = ReadVar<T, VarClaimed>
type Claimed = ReadVar<T, VarClaimed>
The claimed version of Self.
Source§fn claim(self, ctx: &mut StepCtx<'_>) -> ClaimedReadVar<T>
fn claim(self, ctx: &mut StepCtx<'_>) -> ClaimedReadVar<T>
Claim the Var for this step, allowing it to be accessed at runtime.
Source§impl<'de, T> Deserialize<'de> for ConfigVar<T>where
T: DeserializeOwned,
impl<'de, T> Deserialize<'de> for ConfigVar<T>where
T: DeserializeOwned,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: Serialize + DeserializeOwned + PartialEq + Eq + Clone> From<ReadVar<T>> for ConfigVar<T>
impl<T: Serialize + DeserializeOwned + PartialEq + Eq + Clone> From<ReadVar<T>> for ConfigVar<T>
Auto Trait Implementations§
impl<T> Freeze for ConfigVar<T>where
T: Freeze,
impl<T> RefUnwindSafe for ConfigVar<T>where
T: RefUnwindSafe,
impl<T> Send for ConfigVar<T>where
T: Send,
impl<T> Sync for ConfigVar<T>where
T: Sync,
impl<T> Unpin for ConfigVar<T>where
T: Unpin,
impl<T> UnsafeUnpin for ConfigVar<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ConfigVar<T>where
T: UnwindSafe,
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