Struct feattle_sync::S3
source · [−]pub struct S3 { /* private fields */ }Expand description
Persist the data in an AWS S3 bucket.
To use it, make sure to activate the cargo feature "s3" in your Cargo.toml.
Example
use feattle_core::{feattles, Feattles};
use feattle_sync::S3;
use rusoto_s3::S3Client;
use rusoto_core::Region;
feattles! {
struct MyToggles {
a: bool,
}
}
// Create a S3 client, read more at the official documentation https://www.rusoto.org
let s3_client = S3Client::new(Region::default());
let persistence = S3::new(s3_client, "my-bucket".to_owned(), "some/s3/prefix/".to_owned());
let my_toggles = MyToggles::new(persistence);Implementations
Trait Implementations
sourceimpl Persist for S3
impl Persist for S3
type Error = S3Error
sourcefn save_current<'life0, 'life1, 'async_trait>(
&'life0 self,
value: &'life1 CurrentValues
) -> Pin<Box<dyn Future<Output = Result<(), S3Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn save_current<'life0, 'life1, 'async_trait>(
&'life0 self,
value: &'life1 CurrentValues
) -> Pin<Box<dyn Future<Output = Result<(), S3Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Save current state of all feattles.
sourcefn load_current<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<CurrentValues>, S3Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn load_current<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<CurrentValues>, S3Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Load the current state of all feattles. With no previous state existed, Ok(None) should be
returned. Read more
sourcefn save_history<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
value: &'life2 ValueHistory
) -> Pin<Box<dyn Future<Output = Result<(), S3Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn save_history<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
value: &'life2 ValueHistory
) -> Pin<Box<dyn Future<Output = Result<(), S3Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Save the full history of a single feattle.
sourcefn load_history<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Option<ValueHistory>, S3Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn load_history<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Option<ValueHistory>, S3Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Load the full history of a single feattle. With the feattle has no history, Ok(None)
should be returned. Read more
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more