1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use super::{Command, Response};
use {Adapter, CommandType, ObjectId, ObjectType, Session, SessionError};
pub fn delete_object<A: Adapter>(
session: &mut Session<A>,
object_id: ObjectId,
object_type: ObjectType,
) -> Result<(), SessionError> {
session.send_command(DeleteObjectCommand {
object_id,
object_type,
})?;
Ok(())
}
#[derive(Serialize, Deserialize, Debug)]
pub(crate) struct DeleteObjectCommand {
pub object_id: ObjectId,
pub object_type: ObjectType,
}
impl Command for DeleteObjectCommand {
type ResponseType = DeleteObjectResponse;
}
#[derive(Serialize, Deserialize, Debug)]
pub(crate) struct DeleteObjectResponse {}
impl Response for DeleteObjectResponse {
const COMMAND_TYPE: CommandType = CommandType::DeleteObject;
}