pub struct MockTweetApiClient {
pub tweets: HashMap<String, Tweet>,
pub search_results: Vec<Tweet>,
pub simulate_error: bool,
}Expand description
Mock implementation of TweetApiClient for testing.
Fields§
§tweets: HashMap<String, Tweet>Pre-configured tweets to return from get_tweet
search_results: Vec<Tweet>Pre-configured search results
simulate_error: boolWhether to simulate an error
Implementations§
Source§impl MockTweetApiClient
impl MockTweetApiClient
Sourcepub fn with_conversation_fixture() -> Self
pub fn with_conversation_fixture() -> Self
Build a mock client with a conversation tree fixture. Returns a mock client containing a root tweet and replies, all sharing the same conversation_id.
Trait Implementations§
Source§impl Default for MockTweetApiClient
impl Default for MockTweetApiClient
Source§impl TweetApiClient for MockTweetApiClient
impl TweetApiClient for MockTweetApiClient
Auto Trait Implementations§
impl Freeze for MockTweetApiClient
impl RefUnwindSafe for MockTweetApiClient
impl Send for MockTweetApiClient
impl Sync for MockTweetApiClient
impl Unpin for MockTweetApiClient
impl UnsafeUnpin for MockTweetApiClient
impl UnwindSafe for MockTweetApiClient
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