pub struct RestStream { /* private fields */ }Expand description
A configured REST API stream that handles pagination, auth, and extraction.
Implementations§
Source§impl RestStream
impl RestStream
Sourcepub fn new(config: RestStreamConfig) -> Result<Self, FaucetError>
pub fn new(config: RestStreamConfig) -> Result<Self, FaucetError>
Create a new stream from the given configuration.
Sourcepub async fn fetch_all(&self) -> Result<Vec<Value>, FaucetError>
pub async fn fetch_all(&self) -> Result<Vec<Value>, FaucetError>
Fetch all records across all pages as raw JSON values.
Sourcepub async fn fetch_all_as<T: for<'de> Deserialize<'de>>(
&self,
) -> Result<Vec<T>, FaucetError>
pub async fn fetch_all_as<T: for<'de> Deserialize<'de>>( &self, ) -> Result<Vec<T>, FaucetError>
Fetch all records and deserialize into typed structs.
Auto Trait Implementations§
impl Freeze for RestStream
impl !RefUnwindSafe for RestStream
impl Send for RestStream
impl Sync for RestStream
impl Unpin for RestStream
impl UnsafeUnpin for RestStream
impl !UnwindSafe for RestStream
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