Skip to content

Commit

Permalink
next steps
Browse files Browse the repository at this point in the history
  • Loading branch information
kuqmua committed Jan 4, 2025
1 parent 40c1790 commit e7f5301
Showing 1 changed file with 295 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3112,8 +3112,302 @@ const _: () = {
}
};

#[derive(
Debug,
Clone,
PartialEq,
Eq,
// postgresql_crud_types_macro_logic_reuse::PostgresqlBaseTypeTokensSqlxPostgresTypesPgRangeSqlxTypesTimePrimitiveDateTime,
// postgresql_crud_types_macro_logic_reuse::PostgresqlBaseTypeTokensWhereElementSqlxPostgresTypesPgRangeSqlxTypesTimePrimitiveDateTime,
)]
pub struct SqlxPostgresTypesPgRangeSqlxTypesTimePrimitiveDateTime(pub sqlx::postgres::types::PgRange<sqlx::types::time::PrimitiveDateTime>);
const _: () = {
#[allow(unused_extern_crates, clippy::useless_attribute)]
extern crate serde as _serde;
#[automatically_derived]
impl _serde::Serialize for SqlxPostgresTypesPgRangeSqlxTypesTimePrimitiveDateTime {
fn serialize<__S>(
&self,
__serializer: __S,
) -> _serde::__private::Result<__S::Ok, __S::Error>
where
__S: _serde::Serializer,
{
let mut __serde_state = _serde::Serializer::serialize_struct(
__serializer,
"SqlxPostgresTypesPgRangeSqlxTypesTimePrimitiveDateTime",
false as usize + 1 + 1,
)?;
_serde::ser::SerializeStruct::serialize_field(
&mut __serde_state,
"start",
&self.0.start,
)?;
_serde::ser::SerializeStruct::serialize_field(
&mut __serde_state,
"end",
&self.0.end,
)?;
_serde::ser::SerializeStruct::end(__serde_state)
}
}
};
const _: () = {
#[allow(unused_extern_crates, clippy::useless_attribute)]
extern crate serde as _serde;
#[automatically_derived]
impl<'de> _serde::Deserialize<'de>
for SqlxPostgresTypesPgRangeSqlxTypesTimePrimitiveDateTime {
fn deserialize<__D>(
__deserializer: __D,
) -> _serde::__private::Result<Self, __D::Error>
where
__D: _serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
enum __Field {
__field0,
__field1,
__ignore,
}
#[doc(hidden)]
struct __FieldVisitor;
impl<'de> _serde::de::Visitor<'de> for __FieldVisitor {
type Value = __Field;
fn expecting(
&self,
__formatter: &mut _serde::__private::Formatter<'_>,
) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(
__formatter,
"field identifier",
)
}
fn visit_u64<__E>(
self,
__value: u64,
) -> _serde::__private::Result<Self::Value, __E>
where
__E: _serde::de::Error,
{
match __value {
0u64 => _serde::__private::Ok(__Field::__field0),
1u64 => _serde::__private::Ok(__Field::__field1),
_ => _serde::__private::Ok(__Field::__ignore),
}
}
fn visit_str<__E>(
self,
__value: &str,
) -> _serde::__private::Result<Self::Value, __E>
where
__E: _serde::de::Error,
{
match __value {
"start" => _serde::__private::Ok(__Field::__field0),
"end" => _serde::__private::Ok(__Field::__field1),
_ => _serde::__private::Ok(__Field::__ignore),
}
}
fn visit_bytes<__E>(
self,
__value: &[u8],
) -> _serde::__private::Result<Self::Value, __E>
where
__E: _serde::de::Error,
{
match __value {
b"start" => _serde::__private::Ok(__Field::__field0),
b"end" => _serde::__private::Ok(__Field::__field1),
_ => _serde::__private::Ok(__Field::__ignore),
}
}
}
impl<'de> _serde::Deserialize<'de> for __Field {
#[inline]
fn deserialize<__D>(
__deserializer: __D,
) -> _serde::__private::Result<Self, __D::Error>
where
__D: _serde::Deserializer<'de>,
{
_serde::Deserializer::deserialize_identifier(
__deserializer,
__FieldVisitor,
)
}
}
#[doc(hidden)]
struct __Visitor<'de> {
marker: _serde::__private::PhantomData<
SqlxPostgresTypesPgRangeSqlxTypesTimePrimitiveDateTime,
>,
lifetime: _serde::__private::PhantomData<&'de ()>,
}
impl<'de> _serde::de::Visitor<'de> for __Visitor<'de> {
type Value = SqlxPostgresTypesPgRangeSqlxTypesTimePrimitiveDateTime;
fn expecting(
&self,
__formatter: &mut _serde::__private::Formatter<'_>,
) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(
__formatter,
"struct SqlxPostgresTypesPgRangeSqlxTypesTimePrimitiveDateTime",
)
}
#[inline]
fn visit_seq<__A>(
self,
mut __seq: __A,
) -> _serde::__private::Result<Self::Value, __A::Error>
where
__A: _serde::de::SeqAccess<'de>,
{
let __field0 = match _serde::de::SeqAccess::next_element::<
std::collections::Bound<SqlxTypesTimePrimitiveDateTime>,
>(&mut __seq)? {
_serde::__private::Some(__value) => __value,
_serde::__private::None => {
return _serde::__private::Err(
_serde::de::Error::invalid_length(
0usize,
&"struct SqlxPostgresTypesPgRangeSqlxTypesTimePrimitiveDateTime with 2 elements",
),
);
}
};
let __field1 = match _serde::de::SeqAccess::next_element::<
std::collections::Bound<SqlxTypesTimePrimitiveDateTime>,
>(&mut __seq)? {
_serde::__private::Some(__value) => __value,
_serde::__private::None => {
return _serde::__private::Err(
_serde::de::Error::invalid_length(
1usize,
&"struct SqlxPostgresTypesPgRangeSqlxTypesTimePrimitiveDateTime with 2 elements",
),
);
}
};
_serde::__private::Ok(SqlxPostgresTypesPgRangeSqlxTypesTimePrimitiveDateTime(sqlx::postgres::types::PgRange {
start: match __field0 {
std::collections::Bound::Included(value) => std::collections::Bound::Included(value.0),
std::collections::Bound::Excluded(value) => std::collections::Bound::Excluded(value.0),
std::collections::Bound::Unbounded => std::collections::Bound::Unbounded,
},
end: match __field1 {
std::collections::Bound::Included(value) => std::collections::Bound::Included(value.0),
std::collections::Bound::Excluded(value) => std::collections::Bound::Excluded(value.0),
std::collections::Bound::Unbounded => std::collections::Bound::Unbounded,
},
}))
}
#[inline]
fn visit_map<__A>(
self,
mut __map: __A,
) -> _serde::__private::Result<Self::Value, __A::Error>
where
__A: _serde::de::MapAccess<'de>,
{
let mut __field0: _serde::__private::Option<
std::collections::Bound<SqlxTypesTimePrimitiveDateTime>,
> = _serde::__private::None;
let mut __field1: _serde::__private::Option<
std::collections::Bound<SqlxTypesTimePrimitiveDateTime>,
> = _serde::__private::None;
while let _serde::__private::Some(__key) = _serde::de::MapAccess::next_key::<
__Field,
>(&mut __map)? {
match __key {
__Field::__field0 => {
if _serde::__private::Option::is_some(&__field0) {
return _serde::__private::Err(
<__A::Error as _serde::de::Error>::duplicate_field("start"),
);
}
__field0 = _serde::__private::Some(
_serde::de::MapAccess::next_value::<
std::collections::Bound<SqlxTypesTimePrimitiveDateTime>,
>(&mut __map)?,
);
}
__Field::__field1 => {
if _serde::__private::Option::is_some(&__field1) {
return _serde::__private::Err(
<__A::Error as _serde::de::Error>::duplicate_field("end"),
);
}
__field1 = _serde::__private::Some(
_serde::de::MapAccess::next_value::<
std::collections::Bound<SqlxTypesTimePrimitiveDateTime>,
>(&mut __map)?,
);
}
_ => {
let _ = _serde::de::MapAccess::next_value::<
_serde::de::IgnoredAny,
>(&mut __map)?;
}
}
}
let __field0 = match __field0 {
_serde::__private::Some(__field0) => __field0,
_serde::__private::None => {
_serde::__private::de::missing_field("start")?
}
};
let __field1 = match __field1 {
_serde::__private::Some(__field1) => __field1,
_serde::__private::None => {
_serde::__private::de::missing_field("end")?
}
};
_serde::__private::Ok(SqlxPostgresTypesPgRangeSqlxTypesTimePrimitiveDateTime(sqlx::postgres::types::PgRange {
start: match __field0 {
std::collections::Bound::Included(value) => std::collections::Bound::Included(value.0),
std::collections::Bound::Excluded(value) => std::collections::Bound::Excluded(value.0),
std::collections::Bound::Unbounded => std::collections::Bound::Unbounded,
},
end: match __field1 {
std::collections::Bound::Included(value) => std::collections::Bound::Included(value.0),
std::collections::Bound::Excluded(value) => std::collections::Bound::Excluded(value.0),
std::collections::Bound::Unbounded => std::collections::Bound::Unbounded,
},
}))
}
}
#[doc(hidden)]
const FIELDS: &'static [&'static str] = &["start", "end"];
_serde::Deserializer::deserialize_struct(
__deserializer,
"SqlxPostgresTypesPgRangeSqlxTypesTimePrimitiveDateTime",
FIELDS,
__Visitor {
marker: _serde::__private::PhantomData::<
SqlxPostgresTypesPgRangeSqlxTypesTimePrimitiveDateTime,
>,
lifetime: _serde::__private::PhantomData,
},
)
}
}
};














// pub struct SqlxPostgresTypesPgRangeSqlxTypesTimePrimitiveDateTime(pub sqlx::postgres::types::PgRange<sqlx::types::time::PrimitiveDateTime>);
// pub struct SqlxPostgresTypesPgRangeSqlxTypesTimeDate(pub sqlx::postgres::types::PgRange<sqlx::types::time::Date>);
// pub struct SqlxPostgresTypesPgRangeSqlxTypesBigDecimal(pub sqlx::postgres::types::PgRange<sqlx::types::BigDecimal>);

Expand Down

0 comments on commit e7f5301

Please sign in to comment.