pub struct StorageAdapter { /* private fields */ }Expand description
Adapts DbPool to the LoopStorage port trait.
Provides cursor persistence (via the cursors table), tweet dedup,
discovered tweet recording, and action logging.
Implementations§
Trait Implementations§
Source§impl LoopStorage for StorageAdapter
impl LoopStorage for StorageAdapter
Source§fn get_cursor<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, LoopError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_cursor<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, LoopError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a persisted cursor value (e.g., since_id for mentions).
Source§fn set_cursor<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
value: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), LoopError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn set_cursor<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
value: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), LoopError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Set a persisted cursor value.
Source§fn tweet_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
tweet_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, LoopError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn tweet_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
tweet_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, LoopError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if a discovered tweet already exists (dedup by tweet ID).
Source§fn store_discovered_tweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tweet: &'life1 LoopTweet,
score: f32,
keyword: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), LoopError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn store_discovered_tweet<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tweet: &'life1 LoopTweet,
score: f32,
keyword: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), LoopError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Store a discovered tweet with its score and matched keyword.
Source§fn log_action<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
action_type: &'life1 str,
status: &'life2 str,
message: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), LoopError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn log_action<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
action_type: &'life1 str,
status: &'life2 str,
message: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), LoopError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Log an action (for audit trail and status reporting).
Auto Trait Implementations§
impl Freeze for StorageAdapter
impl !RefUnwindSafe for StorageAdapter
impl Send for StorageAdapter
impl Sync for StorageAdapter
impl Unpin for StorageAdapter
impl UnsafeUnpin for StorageAdapter
impl !UnwindSafe for StorageAdapter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more