32 lines
766 B
Rust
32 lines
766 B
Rust
use crate::{
|
|
commands::{
|
|
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
|
},
|
|
Request,
|
|
};
|
|
|
|
pub struct Unmount;
|
|
|
|
impl Command for Unmount {
|
|
type Response = ();
|
|
const COMMAND: &'static str = "unmount";
|
|
|
|
fn parse_request(mut parts: std::str::SplitWhitespace<'_>) -> RequestParserResult<'_> {
|
|
let path = parts
|
|
.next()
|
|
.ok_or(RequestParserError::UnexpectedEOF)?
|
|
.to_string();
|
|
|
|
debug_assert!(parts.next().is_none());
|
|
|
|
Ok((Request::Unmount(path), ""))
|
|
}
|
|
|
|
fn parse_response(
|
|
parts: ResponseAttributes<'_>,
|
|
) -> Result<Self::Response, ResponseParserError> {
|
|
debug_assert!(parts.is_empty());
|
|
Ok(())
|
|
}
|
|
}
|