fluss/rpc/message/
drop_table.rs1use crate::metadata::TablePath;
19use crate::{impl_read_version_type, impl_write_version_type, proto};
20
21use crate::proto::DropTableResponse;
22use crate::rpc::frame::ReadError;
23
24use crate::rpc::api_key::ApiKey;
25use crate::rpc::api_version::ApiVersion;
26use crate::rpc::convert::to_table_path;
27use crate::rpc::frame::WriteError;
28use crate::rpc::message::{ReadVersionedType, RequestBody, WriteVersionedType};
29
30use bytes::{Buf, BufMut};
31use prost::Message;
32
33#[derive(Debug)]
34pub struct DropTableRequest {
35 pub inner_request: proto::DropTableRequest,
36}
37
38impl DropTableRequest {
39 pub fn new(table_path: &TablePath, ignore_if_not_exists: bool) -> Self {
40 DropTableRequest {
41 inner_request: proto::DropTableRequest {
42 table_path: to_table_path(table_path),
43 ignore_if_not_exists,
44 },
45 }
46 }
47}
48
49impl RequestBody for DropTableRequest {
50 type ResponseBody = DropTableResponse;
51
52 const API_KEY: ApiKey = ApiKey::DropTable;
53
54 const REQUEST_VERSION: ApiVersion = ApiVersion(0);
55}
56
57impl_write_version_type!(DropTableRequest);
58impl_read_version_type!(DropTableResponse);