pub struct AppState {
pub store: Arc<SessionStore>,
pub executor: Arc<CommandExecutor>,
pub audit: Arc<AuditSink>,
pub fs: Option<Arc<FsRoot>>,
pub uploads: Arc<UploadStore>,
}Expand description
Shared application state.
Fields§
§store: Arc<SessionStore>§executor: Arc<CommandExecutor>§audit: Arc<AuditSink>Where execution events are recorded; disabled unless configured.
fs: Option<Arc<FsRoot>>The directory the filesystem API may touch.
None means the API is off. Off by default: a gateway that starts
serving files because it was started is not what an operator asked for.
uploads: Arc<UploadStore>In-flight uploads. Always present; useless until fs is set.
Implementations§
Source§impl AppState
impl AppState
pub fn new() -> Self
Sourcepub fn with_audit(self, sink: Arc<AuditSink>) -> Self
pub fn with_audit(self, sink: Arc<AuditSink>) -> Self
Record execution events to sink.
Sourcepub fn with_fs_root(self, root: FsRoot) -> Self
pub fn with_fs_root(self, root: FsRoot) -> Self
Enable the filesystem API, confined to root.
Sourcepub fn with_chunk_size(self, chunk_size: usize) -> Self
pub fn with_chunk_size(self, chunk_size: usize) -> Self
Advertise a different chunk size to upload clients.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppState
impl RefUnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
impl UnwindSafe for AppState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.