Struct feattle_sync::S3[][src]

pub struct S3 { /* fields omitted */ }

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

impl S3[src]

pub fn new(client: S3Client, bucket: String, prefix: String) -> Self[src]

Trait Implementations

impl Clone for S3[src]

fn clone(&self) -> S3[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for S3[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Persist for S3[src]

type Error = S3Error

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, 
[src]

Save current state of all feattles.

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, 
[src]

Load the current state of all feattles. With no previous state existed, Ok(None) should be returned. Read more

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, 
[src]

Save the full history of a single feattle.

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, 
[src]

Load the full history of a single feattle. With the feattle has no history, Ok(None) should be returned. Read more

Auto Trait Implementations

impl !RefUnwindSafe for S3

impl Send for S3

impl Sync for S3

impl Unpin for S3

impl !UnwindSafe for S3

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.