[][src]Enum greetd_ipc::Request

pub enum Request {
    CreateSession {
        username: String,
    },
    PostAuthMessageResponse {
        response: Option<String>,
    },
    StartSession {
        cmd: Vec<String>,
    },
    CancelSession,
}

A request from a greeter to greetd. The request type is internally tagged with the"type" field, with the type written in snake_case.

Example serialization:

{
   "type": "create_session",
   "username": "bob"
}

Variants

CreateSession

CreateSession initiates a login attempt for the given user. CreateSession returns either a Response::AuthMessage, Response::Success or Response::Failure.

If an auth message is returned, it should be answered with a Request::PostAuthMessageResponse. If a success is returned, the session can then be started with Request::StartSession.

If a login flow needs to be aborted at any point, send Request::CancelSession. Note that the session is cancelled automatically on error.

Fields of CreateSession

username: String
PostAuthMessageResponse

PostAuthMessageResponse responds to the last auth message, and returns either a Response::AuthMessage, Response::Success or Response::Failure.

If an auth message is returned, it should be answered with a Request::PostAuthMessageResponse. If a success is returned, the session can then be started with Request::StartSession.

Fields of PostAuthMessageResponse

response: Option<String>
StartSession

Start a successfully logged in session. This will fail if the session has pending messages or has encountered an error.

Fields of StartSession

cmd: Vec<String>
CancelSession

Cancel a session. This can only be done if the session has not been started. Cancel does not have to be called if an error has been encountered in its setup or login flow.

Trait Implementations

impl Debug for Request[src]

impl<'de> Deserialize<'de> for Request[src]

impl Serialize for Request[src]

impl SyncCodec for Request[src]

impl TokioCodec for Request[src]

Auto Trait Implementations

impl RefUnwindSafe for Request

impl Send for Request

impl Sync for Request

impl Unpin for Request

impl UnwindSafe for Request

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.