pub trait BatchApprovalStore: Send + Sync {
// Required methods
fn store(&self, batch: &BatchApproval) -> Result<(), ApprovalStoreError>;
fn find_matching(
&self,
subject_id: &str,
server_id: &str,
tool_name: &str,
amount: Option<&MonetaryAmount>,
now: u64,
) -> Result<Option<BatchApproval>, ApprovalStoreError>;
fn record_usage(
&self,
batch_id: &str,
amount: Option<&MonetaryAmount>,
) -> Result<(), ApprovalStoreError>;
fn revoke(&self, batch_id: &str) -> Result<(), ApprovalStoreError>;
fn get(
&self,
batch_id: &str,
) -> Result<Option<BatchApproval>, ApprovalStoreError>;
}Expand description
Store for batch approvals. Counterpart to ApprovalStore.
Required Methods§
fn store(&self, batch: &BatchApproval) -> Result<(), ApprovalStoreError>
fn find_matching( &self, subject_id: &str, server_id: &str, tool_name: &str, amount: Option<&MonetaryAmount>, now: u64, ) -> Result<Option<BatchApproval>, ApprovalStoreError>
fn record_usage( &self, batch_id: &str, amount: Option<&MonetaryAmount>, ) -> Result<(), ApprovalStoreError>
fn revoke(&self, batch_id: &str) -> Result<(), ApprovalStoreError>
fn get( &self, batch_id: &str, ) -> Result<Option<BatchApproval>, ApprovalStoreError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".