Struct Var

Source
pub struct Var<T>(/* private fields */);
Expand description

a variable stored on the filesystem (very secure ๐Ÿ”)

Implementationsยง

Sourceยง

impl<T> Var<T>

Source

pub fn new(name: &'static str) -> Self

create a var

Sourceยง

impl<T: Serialize> Var<T>

Source

pub fn set(&self, v: &T)

interior mutability!

let x = def!(x = 5u8);
x.set(&3u8);
Sourceยง

impl<T: DeserializeOwned> Var<T>

Source

pub fn get(&self) -> T

procure the stored variable

let y = def!(y = 5u8);
assert_eq!(y.get(), 5u8);

Trait Implementationsยง

Sourceยง

impl<T: Add<T, Output = T> + Clone + DeserializeOwned + Serialize> AddAssign<T> for Var<T>

Sourceยง

fn add_assign(&mut self, rhs: T)

Performs the += operation. Read more
Sourceยง

impl<T: Add<T, Output = T> + Clone + DeserializeOwned + Serialize> AddAssign for Var<T>

Sourceยง

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Sourceยง

impl<T: BitAnd<T, Output = T> + Clone + DeserializeOwned + Serialize> BitAndAssign<T> for Var<T>

Sourceยง

fn bitand_assign(&mut self, rhs: T)

Performs the &= operation. Read more
Sourceยง

impl<T: BitAnd<T, Output = T> + Clone + DeserializeOwned + Serialize> BitAndAssign for Var<T>

Sourceยง

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
Sourceยง

impl<T: BitOr<T, Output = T> + Clone + DeserializeOwned + Serialize> BitOrAssign<T> for Var<T>

Sourceยง

fn bitor_assign(&mut self, rhs: T)

Performs the |= operation. Read more
Sourceยง

impl<T: BitOr<T, Output = T> + Clone + DeserializeOwned + Serialize> BitOrAssign for Var<T>

Sourceยง

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
Sourceยง

impl<T: BitXor<T, Output = T> + Clone + DeserializeOwned + Serialize> BitXorAssign<T> for Var<T>

Sourceยง

fn bitxor_assign(&mut self, rhs: T)

Performs the ^= operation. Read more
Sourceยง

impl<T: BitXor<T, Output = T> + Clone + DeserializeOwned + Serialize> BitXorAssign for Var<T>

Sourceยง

fn bitxor_assign(&mut self, rhs: Self)

Performs the ^= operation. Read more
Sourceยง

impl<T: Div<T, Output = T> + Clone + DeserializeOwned + Serialize> DivAssign<T> for Var<T>

Sourceยง

fn div_assign(&mut self, rhs: T)

Performs the /= operation. Read more
Sourceยง

impl<T: Div<T, Output = T> + Clone + DeserializeOwned + Serialize> DivAssign for Var<T>

Sourceยง

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
Sourceยง

impl<T: Mul<T, Output = T> + Clone + DeserializeOwned + Serialize> MulAssign<T> for Var<T>

Sourceยง

fn mul_assign(&mut self, rhs: T)

Performs the *= operation. Read more
Sourceยง

impl<T: Mul<T, Output = T> + Clone + DeserializeOwned + Serialize> MulAssign for Var<T>

Sourceยง

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Sourceยง

impl<T: Rem<T, Output = T> + Clone + DeserializeOwned + Serialize> RemAssign<T> for Var<T>

Sourceยง

fn rem_assign(&mut self, rhs: T)

Performs the %= operation. Read more
Sourceยง

impl<T: Rem<T, Output = T> + Clone + DeserializeOwned + Serialize> RemAssign for Var<T>

Sourceยง

fn rem_assign(&mut self, rhs: Self)

Performs the %= operation. Read more
Sourceยง

impl<T: Shl<T, Output = T> + Clone + DeserializeOwned + Serialize> ShlAssign<T> for Var<T>

Sourceยง

fn shl_assign(&mut self, rhs: T)

Performs the <<= operation. Read more
Sourceยง

impl<T: Shl<T, Output = T> + Clone + DeserializeOwned + Serialize> ShlAssign for Var<T>

Sourceยง

fn shl_assign(&mut self, rhs: Self)

Performs the <<= operation. Read more
Sourceยง

impl<T: Shr<T, Output = T> + Clone + DeserializeOwned + Serialize> ShrAssign<T> for Var<T>

Sourceยง

fn shr_assign(&mut self, rhs: T)

Performs the >>= operation. Read more
Sourceยง

impl<T: Shr<T, Output = T> + Clone + DeserializeOwned + Serialize> ShrAssign for Var<T>

Sourceยง

fn shr_assign(&mut self, rhs: Self)

Performs the >>= operation. Read more
Sourceยง

impl<T: Sub<T, Output = T> + Clone + DeserializeOwned + Serialize> SubAssign<T> for Var<T>

Sourceยง

fn sub_assign(&mut self, rhs: T)

Performs the -= operation. Read more
Sourceยง

impl<T: Sub<T, Output = T> + Clone + DeserializeOwned + Serialize> SubAssign for Var<T>

Sourceยง

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more

Auto Trait Implementationsยง

ยง

impl<T> Freeze for Var<T>

ยง

impl<T> RefUnwindSafe for Var<T>
where T: RefUnwindSafe,

ยง

impl<T> Send for Var<T>
where T: Send,

ยง

impl<T> Sync for Var<T>
where T: Sync,

ยง

impl<T> Unpin for Var<T>
where T: Unpin,

ยง

impl<T> UnwindSafe for Var<T>
where T: UnwindSafe,

Blanket Implementationsยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.