unitycatalog_server/codegen/volumes/handler.rs
1// @generated — do not edit by hand.
2//! Handler trait for [`VolumeHandler`].
3//!
4//! Implement this trait to provide a custom backend for this service, then mount the
5//! generated handler functions (in the sibling `server` module) onto an `axum::Router`
6//! with your implementation as state.
7//!
8//! # Composability
9//!
10//! A single struct can implement multiple handler traits to serve multiple
11//! services. Use [`axum::Router::merge`] to compose per-service routers together.
12//!
13//! Service for managing volumes in Unity Catalog.
14//! Volumes represent logical storage locations (managed or external) within a schema.
15use crate::Result;
16use async_trait::async_trait;
17use unitycatalog_common::models::volumes::v1::*;
18#[async_trait]
19pub trait VolumeHandler<Cx = crate::api::RequestContext>: Send + Sync + 'static {
20 /// Lists volumes.
21 async fn list_volumes(
22 &self,
23 request: ListVolumesRequest,
24 context: Cx,
25 ) -> Result<ListVolumesResponse>;
26 async fn create_volume(&self, request: CreateVolumeRequest, context: Cx) -> Result<Volume>;
27 async fn get_volume(&self, request: GetVolumeRequest, context: Cx) -> Result<Volume>;
28 async fn update_volume(&self, request: UpdateVolumeRequest, context: Cx) -> Result<Volume>;
29 async fn delete_volume(&self, request: DeleteVolumeRequest, context: Cx) -> Result<()>;
30}