pub enum Request {
Ping(RequestPing),
Handshake(RequestHandshake),
Phrases(RequestPhrases),
Inspect(RequestInspect),
}
Expand description
The toplevel request of the JSON specification.
This comes in three variants:
Request::Ping
to establish if a server is online.Request::Handshake
to retrieve server metadata, such as supported versions, reasoner used, etc.Request::Phrases
to send eFLINT phrases to the server and do reasoning.
Variants§
Ping(RequestPing)
The Ping-request can be used to establish if a server is online and reachable.
Handshake(RequestHandshake)
The Handshake-request can be used to retrieve server metadata, such as supported versions, reasoner used, etc.
Phrases(RequestPhrases)
The Phrases-request can be used to do reasoning on the server by sending phrases.
Inspect(RequestInspect)
The Inspect-request can be used to query the server’s state.
Implementations§
Source§impl Request
impl Request
Sourcepub fn ping(&self) -> &RequestPing
pub fn ping(&self) -> &RequestPing
Returns this Request as if it’s a Request::Ping
.
§Returns
A reference to the internal RequestPing
object.
§Panics
This function may panic if this Request is not a Request::Ping
.
Sourcepub fn ping_mut(&mut self) -> &mut RequestPing
pub fn ping_mut(&mut self) -> &mut RequestPing
Returns this Request as if it’s a Request::Ping
.
§Returns
A mutable reference to the internal RequestPing
object.
§Panics
This function may panic if this Request is not a Request::Ping
.
Sourcepub fn into_ping(self) -> RequestPing
pub fn into_ping(self) -> RequestPing
Returns this Request as if it’s a Request::Ping
.
§Returns
The internal RequestPing
object.
§Panics
This function may panic if this Request is not a Request::Ping
.
Sourcepub fn is_handshake(&self) -> bool
pub fn is_handshake(&self) -> bool
Sourcepub fn handshake(&self) -> &RequestHandshake
pub fn handshake(&self) -> &RequestHandshake
Returns this Request as if it’s a Request::Handshake
.
§Returns
A reference to the internal RequestHandshake
object.
§Panics
This function may panic if this Request is not a Request::Handshake
.
Sourcepub fn handshake_mut(&mut self) -> &mut RequestHandshake
pub fn handshake_mut(&mut self) -> &mut RequestHandshake
Returns this Request as if it’s a Request::Handshake
.
§Returns
A mutable reference to the internal RequestHandshake
object.
§Panics
This function may panic if this Request is not a Request::Handshake
.
Sourcepub fn into_handshake(self) -> RequestHandshake
pub fn into_handshake(self) -> RequestHandshake
Returns this Request as if it’s a Request::Handshake
.
§Returns
The internal RequestHandshake
object.
§Panics
This function may panic if this Request is not a Request::Handshake
.
Sourcepub fn is_phrases(&self) -> bool
pub fn is_phrases(&self) -> bool
Sourcepub fn phrases(&self) -> &RequestPhrases
pub fn phrases(&self) -> &RequestPhrases
Returns this Request as if it’s a Request::Phrases
.
§Returns
A reference to the internal RequestPhrases
object.
§Panics
This function may panic if this Request is not a Request::Phrases
.
Sourcepub fn phrases_mut(&mut self) -> &mut RequestPhrases
pub fn phrases_mut(&mut self) -> &mut RequestPhrases
Returns this Request as if it’s a Request::Phrases
.
§Returns
A mutable reference to the internal RequestPhrases
object.
§Panics
This function may panic if this Request is not a Request::Phrases
.
Sourcepub fn into_phrases(self) -> RequestPhrases
pub fn into_phrases(self) -> RequestPhrases
Returns this Request as if it’s a Request::Phrases
.
§Returns
The internal RequestPhrases
object.
§Panics
This function may panic if this Request is not a Request::Phrases
.
Sourcepub fn is_inspect(&self) -> bool
pub fn is_inspect(&self) -> bool
Sourcepub fn inspect(&self) -> &RequestInspect
pub fn inspect(&self) -> &RequestInspect
Returns this Request as if it’s a Request::Inspect
.
§Returns
A reference to the internal RequestInspect
object.
§Panics
This function may panic if this Request is not a Request::Inspect
.
Sourcepub fn inspect_mut(&mut self) -> &mut RequestInspect
pub fn inspect_mut(&mut self) -> &mut RequestInspect
Returns this Request as if it’s a Request::Inspect
.
§Returns
A mutable reference to the internal RequestInspect
object.
§Panics
This function may panic if this Request is not a Request::Inspect
.
Sourcepub fn into_inspect(self) -> RequestInspect
pub fn into_inspect(self) -> RequestInspect
Returns this Request as if it’s a Request::Inspect
.
§Returns
The internal RequestInspect
object.
§Panics
This function may panic if this Request is not a Request::Inspect
.