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;
}