derive Debug for AirtableRecord
This commit is contained in:
parent
7532694a92
commit
eb5e2f4847
3 changed files with 15 additions and 8 deletions
|
@ -1,3 +1,5 @@
|
|||
use std::fmt::Debug;
|
||||
|
||||
use derive_builder::Builder;
|
||||
use percent_encoding::{NON_ALPHANUMERIC, utf8_percent_encode};
|
||||
use serde::de::DeserializeOwned;
|
||||
|
@ -27,7 +29,7 @@ where
|
|||
#[derive(Clone, Deserialize)]
|
||||
pub struct CreateRecordsResponse<T>
|
||||
where
|
||||
T: Clone + Serialize,
|
||||
T: Clone + Debug + Serialize,
|
||||
{
|
||||
/// Records successfully created in Airtable.
|
||||
pub records: Vec<AirtableRecord<T>>,
|
||||
|
@ -47,7 +49,7 @@ pub struct CreateRecordsDetails {
|
|||
|
||||
impl<T> CreateRecordsQuery<T>
|
||||
where
|
||||
T: Clone + DeserializeOwned + Serialize,
|
||||
T: Clone + Debug + DeserializeOwned + Serialize,
|
||||
{
|
||||
/// Execute the API request.
|
||||
///
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
use std::collections::VecDeque;
|
||||
use std::fmt::Debug;
|
||||
use std::pin::Pin;
|
||||
|
||||
use derive_builder::Builder;
|
||||
|
@ -53,7 +54,7 @@ pub struct ListRecordsQuery {
|
|||
|
||||
impl<T> PaginatedQuery<AirtableRecord<T>, ListRecordsResponse<T>> for ListRecordsQuery
|
||||
where
|
||||
T: Clone + DeserializeOwned,
|
||||
T: Clone + Debug + DeserializeOwned,
|
||||
{
|
||||
fn get_offset(&self) -> Option<String> {
|
||||
self.offset.clone()
|
||||
|
@ -77,7 +78,7 @@ impl ListRecordsQuery {
|
|||
self,
|
||||
) -> Pin<Box<impl Stream<Item = Result<AirtableRecord<T>, ExecutionError>>>>
|
||||
where
|
||||
T: Clone + DeserializeOwned,
|
||||
T: Clone + Debug + DeserializeOwned,
|
||||
{
|
||||
execute_paginated::<AirtableRecord<T>, ListRecordsResponse<T>>(self)
|
||||
}
|
||||
|
@ -86,7 +87,7 @@ impl ListRecordsQuery {
|
|||
#[derive(Clone, Deserialize)]
|
||||
struct ListRecordsResponse<T>
|
||||
where
|
||||
T: Clone,
|
||||
T: Clone + Debug,
|
||||
{
|
||||
offset: Option<String>,
|
||||
records: VecDeque<AirtableRecord<T>>,
|
||||
|
@ -94,7 +95,7 @@ where
|
|||
|
||||
impl<T> PaginatedResponse<AirtableRecord<T>> for ListRecordsResponse<T>
|
||||
where
|
||||
T: Clone + DeserializeOwned,
|
||||
T: Clone + Debug + DeserializeOwned,
|
||||
{
|
||||
fn get_offset(&self) -> Option<String> {
|
||||
self.offset.clone()
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
use std::fmt::Debug;
|
||||
|
||||
#[cfg(feature = "chrono")]
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Clone, Deserialize)]
|
||||
// TODO: Write custom implementation of `Debug` trait that allows the `T: Debug`
|
||||
// bound to be removed.
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
pub struct AirtableRecord<T>
|
||||
where
|
||||
T: Clone,
|
||||
T: Clone + Debug,
|
||||
{
|
||||
/// Record ID.
|
||||
pub id: String,
|
||||
|
|
Loading…
Add table
Reference in a new issue