pub enum Role {
Nothing,
Contributor,
Operator,
}Expand description
What one machine is set up as, in the vocabulary the documentation uses.
Three personas, and a machine is at most one of them: a reviewer never opens a terminal, so no local state can say “reviewer” and the enum does not pretend otherwise.
Variants§
Nothing
Nothing has been set up here yet.
Contributor
Holds a credential for somebody else’s node.
Operator
Runs a node: choir init has written a repository root here.
Implementations§
Source§impl Role
impl Role
Sourcepub fn of(state: &Path, auth_file: Option<&str>) -> Role
pub fn of(state: &Path, auth_file: Option<&str>) -> Role
Reads the role off the two paths that distinguish it.
state is ~/.choir. The operator test is the repository root
choir init creates, not the credential — an operator’s node
issues itself one too, so the credential alone cannot tell the
two apart, and the root is the thing only an operator has.
Trait Implementations§
impl Copy for Role
impl Eq for Role
impl StructuralPartialEq for Role
Auto Trait Implementations§
impl Freeze for Role
impl RefUnwindSafe for Role
impl Send for Role
impl Sync for Role
impl Unpin for Role
impl UnsafeUnpin for Role
impl UnwindSafe for Role
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