pub trait S3Delivery: Send + Sync {
// Required methods
fn put_object(
&self,
account_id: &str,
bucket: &str,
key: &str,
body: Vec<u8>,
content_type: Option<&str>,
) -> Result<(), String>;
fn get_object(
&self,
account_id: &str,
bucket: &str,
key: &str,
) -> Result<Vec<u8>, String>;
}Expand description
Cross-service S3 writer used by services that need to deliver content to S3 buckets without taking a direct dep on the S3 crate (CloudWatch Logs export tasks, Kinesis Firehose, ELB access logs).
Required Methods§
Sourcefn put_object(
&self,
account_id: &str,
bucket: &str,
key: &str,
body: Vec<u8>,
content_type: Option<&str>,
) -> Result<(), String>
fn put_object( &self, account_id: &str, bucket: &str, key: &str, body: Vec<u8>, content_type: Option<&str>, ) -> Result<(), String>
Put an object to a bucket. Returns the bucket name on success or an error string the caller can surface in tests / logs.
Sourcefn get_object(
&self,
account_id: &str,
bucket: &str,
key: &str,
) -> Result<Vec<u8>, String>
fn get_object( &self, account_id: &str, bucket: &str, key: &str, ) -> Result<Vec<u8>, String>
Read an object’s body. Returns Err when the bucket or key does
not exist or when the body cannot be read. Used by RDS
RestoreDBInstanceFromS3 to ingest a backup blob without taking
a direct dep on the S3 crate.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".