pub struct State {
pub numbers: BTreeMap<String, u32>,
pub synced_at: BTreeMap<String, String>,
pub exported: BTreeMap<String, u64>,
pub workspace: Option<String>,
}Expand description
The identity map tix keeps between a beads workspace and its store.
Only beads-originated issues need an entry: a bead tix exported has a
deterministic <prefix>-<number> id, which is its own mapping. The file is
small, and it is identity rather than cache — losing it would make the
next import create a second tix issue for a bead that already has one — so it
is written to the project root and is safe to commit.
Fields§
§numbers: BTreeMap<String, u32>beads id → tix issue number, for beads-originated issues.
synced_at: BTreeMap<String, String>beads id → the updated_at last seen, the watermark that stops the two
pipes echoing each other’s change back.
exported: BTreeMap<String, u64>beads id → fingerprint of the row last exported for it.
This is the outbound watermark: a row that fingerprints the same as the one already sent has not changed, so a re-export can skip it. It is what makes a second export cheap on a repository with thousands of issues.
Only meaningful together with Self::workspace: a fingerprint records
that a row was exported somewhere, and skipping is only correct when
“somewhere” is still the workspace in front of us.
workspace: Option<String>The workspace Self::exported was written against.
None in a state file written before this was recorded, which is itself a
reason not to trust the watermark: the export compares it and resets when it
differs, so pointing tix at a different workspace re-exports everything
instead of silently sending nothing.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for State
impl<'de> Deserialize<'de> for State
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>,
impl Eq for State
impl StructuralPartialEq for State
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
impl UnwindSafe for State
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more