pub enum Command {
Show 15 variants
Hello,
Station {
station: String,
network: String,
},
Select {
pattern: String,
},
Data {
sequence: Option<SequenceNumber>,
start: Option<String>,
end: Option<String>,
},
End,
Bye,
Info {
level: InfoLevel,
},
Batch,
Fetch {
sequence: Option<SequenceNumber>,
},
Time {
start: String,
end: Option<String>,
},
Cat,
SlProto {
version: String,
},
Auth {
value: String,
},
UserAgent {
description: String,
},
EndFetch,
}Variants§
Hello
Station
Select
Data
End
Bye
Info
Batch
Fetch
Fields
§
sequence: Option<SequenceNumber>Time
Cat
SlProto
Auth
UserAgent
EndFetch
Implementations§
Source§impl Command
impl Command
Sourcepub fn parse(line: &str) -> Result<Self>
pub fn parse(line: &str) -> Result<Self>
Parse a command from a text line (version-agnostic).
The line should NOT include the trailing \r\n.
Sourcepub fn to_bytes(&self, version: ProtocolVersion) -> Result<Vec<u8>>
pub fn to_bytes(&self, version: ProtocolVersion) -> Result<Vec<u8>>
Serialize to wire bytes for the given protocol version.
Returns Err(VersionMismatch) if the command is not valid for the version.
Sourcepub fn is_valid_for(&self, version: ProtocolVersion) -> bool
pub fn is_valid_for(&self, version: ProtocolVersion) -> bool
Check if this command is valid for the given protocol version.
Trait Implementations§
impl Eq for Command
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
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