pub struct Ui { /* private fields */ }Expand description
Everything the handlers touch.
The queue, the runs directory and the magi home are fields rather than process-global lookups so a test drives the real router against a temp directory instead of the operator’s own history.
Implementations§
Source§impl Ui
impl Ui
Sourcepub fn new(
queue: Queue,
questions: Questions,
talks: Talks,
runs: PathBuf,
home: PathBuf,
repo: PathBuf,
) -> Self
pub fn new( queue: Queue, questions: Questions, talks: Talks, runs: PathBuf, home: PathBuf, repo: PathBuf, ) -> Self
A server over explicit paths.
Sourcepub fn open(repo: PathBuf) -> Self
pub fn open(repo: PathBuf) -> Self
The operator’s own state: <home>/queue, <home>/questions,
<home>/talks, <home>/runs.
Sourcepub fn with_merge(self, merge: Option<String>) -> Self
pub fn with_merge(self, merge: Option<String>) -> Self
The merge mode the loop should use, as the command line gave it.
A builder step rather than a seventh parameter on Ui::new, because
the override is a property of how this process was invoked and not of
where its state lives - which is all the tests that build a Ui by
hand are saying.
Sourcepub fn with_worktrees_root(self, root: PathBuf) -> Self
pub fn with_worktrees_root(self, root: PathBuf) -> Self
Where the runs’ worktrees live, when it is not the default.
The health view sizes this directory, so a test that leaves it at the default would be measuring the operator’s own machine.
Sourcepub fn router(self) -> Router
pub fn router(self) -> Router
The router, with this state baked in.
The three front-end files get one explicit route each rather than a
path parameter, so there is no traversal surface to get wrong: the set
of servable paths is the set written here. The asset route below is the
one exception and the only place in this server where a client names a
file; it is why [valid_asset_name] is checked before a path is built.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Ui
impl !UnwindSafe for Ui
impl Forget for Ui
impl Freeze for Uiwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<dyn Fn() -> String + Send + Sync> is !null: Freeze,
PhantomData<ArcInner<dyn Fn() -> String + Send + Sync>>: Freeze,
*const ArcInner<Mutex<()>> is !null: Freeze,
PhantomData<ArcInner<Mutex<()>>>: Freeze,
*const ArcInner<IndexCache> is !null: Freeze,
PhantomData<ArcInner<IndexCache>>: Freeze,
*const ArcInner<Mutex<TalkTurns>> is !null: Freeze,
PhantomData<ArcInner<Mutex<TalkTurns>>>: Freeze,
*const ArcInner<RwLock<bool>> is !null: Freeze,
PhantomData<ArcInner<RwLock<bool>>>: Freeze,
*const ArcInner<Mutex<()>> is !null: Freeze,
PhantomData<ArcInner<Mutex<()>>>: Freeze,
*const ArcInner<Atomic<bool>> is !null: Freeze,
PhantomData<ArcInner<Atomic<bool>>>: Freeze,
*const ArcInner<Mutex<Option<UpgradeRequestFailure>>> is !null: Freeze,
PhantomData<ArcInner<Mutex<Option<UpgradeRequestFailure>>>>: Freeze,
*const ArcInner<Mutex<Option<String>>> is !null: Freeze,
PhantomData<ArcInner<Mutex<Option<String>>>>: Freeze,
*const ArcInner<Mutex<HashSet<String>>> is !null: Freeze,
PhantomData<ArcInner<Mutex<HashSet<String>>>>: Freeze,
*const ArcInner<Mutex<State>> is !null: Freeze,
PhantomData<ArcInner<Mutex<State>>>: Freeze,
*const ArcInner<Mutex<LoopState>> is !null: Freeze,
PhantomData<ArcInner<Mutex<LoopState>>>: Freeze,
*const ArcInner<SharedMonitor> is !null: Freeze,
PhantomData<ArcInner<SharedMonitor>>: Freeze,
impl Move for Ui
impl Send for Uiwhere
RawVecInner: Send,
Arc<dyn Fn() -> String + Send + Sync>: Send,
Arc<Mutex<()>>: Send,
Arc<IndexCache>: Send,
Arc<Mutex<TalkTurns>>: Send,
Arc<RwLock<bool>>: Send,
Arc<Mutex<()>>: Send,
Arc<Atomic<bool>>: Send,
Arc<Mutex<Option<UpgradeRequestFailure>>>: Send,
Arc<Mutex<Option<String>>>: Send,
Arc<Mutex<HashSet<String>>>: Send,
Arc<Mutex<State>>: Send,
Arc<Mutex<LoopState>>: Send,
Arc<SharedMonitor>: Send,
impl Sync for Uiwhere
RawVecInner: Sync,
Arc<dyn Fn() -> String + Send + Sync>: Sync,
Arc<Mutex<()>>: Sync,
Arc<IndexCache>: Sync,
Arc<Mutex<TalkTurns>>: Sync,
Arc<RwLock<bool>>: Sync,
Arc<Mutex<()>>: Sync,
Arc<Atomic<bool>>: Sync,
Arc<Mutex<Option<UpgradeRequestFailure>>>: Sync,
Arc<Mutex<Option<String>>>: Sync,
Arc<Mutex<HashSet<String>>>: Sync,
Arc<Mutex<State>>: Sync,
Arc<Mutex<LoopState>>: Sync,
Arc<SharedMonitor>: Sync,
impl Unpin for Uiwhere
*const u8 is !null: Unpin,
Arc<dyn Fn() -> String + Send + Sync>: Unpin,
Arc<Mutex<()>>: Unpin,
Arc<IndexCache>: Unpin,
Arc<Mutex<TalkTurns>>: Unpin,
Arc<RwLock<bool>>: Unpin,
Arc<Mutex<()>>: Unpin,
Arc<Atomic<bool>>: Unpin,
Arc<Mutex<Option<UpgradeRequestFailure>>>: Unpin,
Arc<Mutex<Option<String>>>: Unpin,
Arc<Mutex<HashSet<String>>>: Unpin,
Arc<Mutex<State>>: Unpin,
Arc<Mutex<LoopState>>: Unpin,
Arc<SharedMonitor>: Unpin,
impl UnsafeUnpin for Uiwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<dyn Fn() -> String + Send + Sync> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn() -> String + Send + Sync>>: UnsafeUnpin,
*const ArcInner<Mutex<()>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<()>>>: UnsafeUnpin,
*const ArcInner<IndexCache> is !null: UnsafeUnpin,
PhantomData<ArcInner<IndexCache>>: UnsafeUnpin,
*const ArcInner<Mutex<TalkTurns>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<TalkTurns>>>: UnsafeUnpin,
*const ArcInner<RwLock<bool>> is !null: UnsafeUnpin,
PhantomData<ArcInner<RwLock<bool>>>: UnsafeUnpin,
*const ArcInner<Mutex<()>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<()>>>: UnsafeUnpin,
*const ArcInner<Atomic<bool>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Atomic<bool>>>: UnsafeUnpin,
*const ArcInner<Mutex<Option<UpgradeRequestFailure>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<Option<UpgradeRequestFailure>>>>: UnsafeUnpin,
*const ArcInner<Mutex<Option<String>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<Option<String>>>>: UnsafeUnpin,
*const ArcInner<Mutex<HashSet<String>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<HashSet<String>>>>: UnsafeUnpin,
*const ArcInner<Mutex<State>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<State>>>: UnsafeUnpin,
*const ArcInner<Mutex<LoopState>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<LoopState>>>: UnsafeUnpin,
*const ArcInner<SharedMonitor> is !null: UnsafeUnpin,
PhantomData<ArcInner<SharedMonitor>>: UnsafeUnpin,
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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