pub struct SessionSlot {
org: String,
project: String,
label: String,
}Expand description
The (org, project, label) triple naming one session. org and
project are the forge.toml names - the same pair the redb
sessions table is keyed by - and label carries the role:
LEAD_LABEL for a project’s lead, the worker’s own label
otherwise.
Fields§
§org: String§project: String§label: StringImplementations§
Source§impl SessionSlot
impl SessionSlot
pub fn new( org: impl Into<String>, project: impl Into<String>, label: impl Into<String>, ) -> Self
Sourcepub fn worker(
org: impl Into<String>,
project: impl Into<String>,
label: impl Into<String>,
) -> Self
pub fn worker( org: impl Into<String>, project: impl Into<String>, label: impl Into<String>, ) -> Self
A worker’s slot: its project plus the label that names it.
Sourcepub fn for_label(org: &str, project: &str, label: Option<&str>) -> Self
pub fn for_label(org: &str, project: &str, label: Option<&str>) -> Self
A slot from a label that may be absent, None meaning the
project’s lead. The shape the cron and Gotify routers hold,
where a durable entry’s team_role names a worker or nothing.
pub fn org(&self) -> &str
pub fn project(&self) -> &str
pub fn label(&self) -> &str
pub fn is_lead(&self) -> bool
Sourcepub fn display(&self) -> String
pub fn display(&self) -> String
The slot’s display string, org/project/label. For tracing and
for the few surfaces that need one string to render; it is not
a key and nothing parses it back.
Sourcepub fn from_str_for_test(s: impl Into<String>) -> Self
pub fn from_str_for_test(s: impl Into<String>) -> Self
Test-only constructor for fixtures across crate boundaries
(workspace, server and harness tests), where a fixture wants a
distinct slot from one opaque name. Gated behind the
test-helpers Cargo feature so production builds don’t carry
the helper.
Trait Implementations§
Source§impl Clone for SessionSlot
impl Clone for SessionSlot
Source§impl Debug for SessionSlot
impl Debug for SessionSlot
Source§impl<'de> Deserialize<'de> for SessionSlot
impl<'de> Deserialize<'de> for SessionSlot
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 SessionSlot
Source§impl Hash for SessionSlot
impl Hash for SessionSlot
Source§impl PartialEq for SessionSlot
impl PartialEq for SessionSlot
Source§impl Serialize for SessionSlot
impl Serialize for SessionSlot
impl StructuralPartialEq for SessionSlot
Auto Trait Implementations§
impl Freeze for SessionSlot
impl RefUnwindSafe for SessionSlot
impl Send for SessionSlot
impl Sync for SessionSlot
impl Unpin for SessionSlot
impl UnsafeUnpin for SessionSlot
impl UnwindSafe for SessionSlot
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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.