pub enum ClientFrame {
Show 13 variants
Hello(Hello),
Ping,
Sessions,
Shutdown {
force: bool,
},
Attach(Attach),
Cmd {
session_id: SessionId,
cmd: SessionCommand,
},
Reload {
now: bool,
drain_secs: Option<u64>,
exe: Option<PathBuf>,
},
Purge,
Close {
session_id: SessionId,
force: bool,
attached: bool,
},
Pin {
session_id: SessionId,
on: bool,
},
AuthState(AuthStateQuery),
ReloadExtension {
extension: String,
},
Bye,
}Expand description
Client → daemon. First frame on a connection MUST be Hello.
Variants§
Hello(Hello)
Ping
Sessions
Shutdown
Attach(Attach)
Cmd
Reload
Control fast path (no session): checkpoint every session, write
reload-state, execv self. Reply: Reloading to every attached
client, Bye to this one. (C3)
Purge
Control fast path: memstat::purge_arenas() in the daemon (bench
hygiene). Reply: Pong. (C2)
Close
Control fast path: end one session as /close [force] would, with
host authority (no attach, never unparks). A session with clients
attached is refused unless attached (--attached); force only
overrides work in flight. Reply: Closed, or
Refused{Busy|UnknownSession}. Not accepted on an attached
connection (that client has /close).
Pin
Control fast path: pin (on) or unpin one session, as /pin on|off
would, with host authority. on is required so a frame always says
which way it goes. Pinning a parked session unparks it; unpinning one
leaves it parked. Reply: Pinned, or Refused{Busy|UnknownSession}.
Not accepted on an attached connection (that client has /pin).
AuthState(AuthStateQuery)
Control fast path (no session): the in-memory account state of the
broker every session of this daemon shares (synaps auth state),
cleared first when clear is set. Reply: AuthState. A daemon that
predates this frame answers Error “malformed frame: unknown variant
auth_state, …” and keeps the connection usable.
ReloadExtension
Control fast path (no session): stop one extension and start it
again from what is installed now (synaps daemon reload-extension).
Extensions are daemon-wide, so every session gets the new version;
no session is checkpointed and no turn is cancelled (only a call
into the old process that is in flight fails). Also loads a plugin
installed after the daemon started. Reply: ExtensionReloaded,
ExtensionReloadFailed, or Refused{Busy} while the daemon
reloads. Not accepted on an attached connection.
Bye
Trait Implementations§
Source§impl Debug for ClientFrame
impl Debug for ClientFrame
Source§impl<'de> Deserialize<'de> for ClientFrame
impl<'de> Deserialize<'de> for ClientFrame
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>,
Auto Trait Implementations§
impl Freeze for ClientFrame
impl RefUnwindSafe for ClientFrame
impl Send for ClientFrame
impl Sync for ClientFrame
impl Unpin for ClientFrame
impl UnsafeUnpin for ClientFrame
impl UnwindSafe for ClientFrame
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.