1use serde_derive::{Deserialize, Serialize};
4use std::borrow::Borrow;
5use std::cmp::Ordering;
6use std::hash::{Hash, Hasher};
7
8#[derive(#[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
{
#[allow(unused_extern_crates, clippy :: useless_attribute)]
extern crate serde as _serde;
;
#[automatically_derived]
impl _serde::Serialize for TeamId {
fn serialize<__S>(&self, __serializer: __S)
-> _serde::__private228::Result<__S::Ok, __S::Error> where
__S: _serde::Serializer {
_serde::Serialize::serialize(&self.0, __serializer)
}
}
};Serialize, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
{
#[allow(unused_extern_crates, clippy :: useless_attribute)]
extern crate serde as _serde;
;
#[automatically_derived]
impl<'de> _serde::Deserialize<'de> for TeamId {
fn deserialize<__D>(__deserializer: __D)
-> _serde::__private228::Result<Self, __D::Error> where
__D: _serde::Deserializer<'de> {
_serde::__private228::Result::map(_serde::Deserialize::deserialize(__deserializer),
|__transparent| TeamId { 0: __transparent })
}
}
};Deserialize, #[automatically_derived]
impl ::core::marker::Copy for TeamId { }Copy, #[automatically_derived]
impl ::core::clone::Clone for TeamId {
#[inline]
fn clone(&self) -> TeamId {
let _: ::core::clone::AssertParamIsClone<u32>;
*self
}
}Clone, #[automatically_derived]
impl ::core::cmp::Ord for TeamId {
#[inline]
fn cmp(&self, other: &TeamId) -> ::core::cmp::Ordering {
::core::cmp::Ord::cmp(&self.0, &other.0)
}
}Ord, #[automatically_derived]
impl ::core::cmp::PartialOrd for TeamId {
#[inline]
fn partial_cmp(&self, other: &TeamId)
-> ::core::option::Option<::core::cmp::Ordering> {
::core::cmp::PartialOrd::partial_cmp(&self.0, &other.0)
}
}PartialOrd, #[automatically_derived]
impl ::core::cmp::Eq for TeamId {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_receiver_is_total_eq(&self) -> () {
let _: ::core::cmp::AssertParamIsEq<u32>;
}
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for TeamId {
#[inline]
fn eq(&self, other: &TeamId) -> bool { self.0 == other.0 }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for TeamId {
#[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
::core::hash::Hash::hash(&self.0, state)
}
}Hash, #[automatically_derived]
impl ::core::fmt::Debug for TeamId {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_tuple_field1_finish(f, "TeamId",
&&self.0)
}
}Debug)]
10#[serde(transparent)]
11#[cfg_attr(not(doc), repr(transparent))]
12pub struct TeamId(pub u32);
13
14#[derive(#[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
{
#[allow(unused_extern_crates, clippy :: useless_attribute)]
extern crate serde as _serde;
;
#[automatically_derived]
impl<'de> _serde::Deserialize<'de> for Row {
fn deserialize<__D>(__deserializer: __D)
-> _serde::__private228::Result<Self, __D::Error> where
__D: _serde::Deserializer<'de> {
#[allow(non_camel_case_types)]
#[doc(hidden)]
enum __Field {
__field0,
__field1,
__field2,
__field3,
__field4,
__field5,
}
#[doc(hidden)]
struct __FieldVisitor;
#[automatically_derived]
impl<'de> _serde::de::Visitor<'de> for __FieldVisitor {
type Value = __Field;
fn expecting(&self,
__formatter: &mut _serde::__private228::Formatter)
-> _serde::__private228::fmt::Result {
_serde::__private228::Formatter::write_str(__formatter,
"field identifier")
}
fn visit_u64<__E>(self, __value: u64)
-> _serde::__private228::Result<Self::Value, __E> where
__E: _serde::de::Error {
match __value {
0u64 => _serde::__private228::Ok(__Field::__field0),
1u64 => _serde::__private228::Ok(__Field::__field1),
2u64 => _serde::__private228::Ok(__Field::__field2),
3u64 => _serde::__private228::Ok(__Field::__field3),
4u64 => _serde::__private228::Ok(__Field::__field4),
5u64 => _serde::__private228::Ok(__Field::__field5),
_ =>
_serde::__private228::Err(_serde::de::Error::invalid_value(_serde::de::Unexpected::Unsigned(__value),
&"field index 0 <= i < 6")),
}
}
fn visit_str<__E>(self, __value: &str)
-> _serde::__private228::Result<Self::Value, __E> where
__E: _serde::de::Error {
match __value {
"id" => _serde::__private228::Ok(__Field::__field0),
"login" => _serde::__private228::Ok(__Field::__field1),
"github_id" => _serde::__private228::Ok(__Field::__field2),
"name" => _serde::__private228::Ok(__Field::__field3),
"avatar" => _serde::__private228::Ok(__Field::__field4),
"org_id" => _serde::__private228::Ok(__Field::__field5),
_ => {
_serde::__private228::Err(_serde::de::Error::unknown_field(__value,
FIELDS))
}
}
}
fn visit_bytes<__E>(self, __value: &[u8])
-> _serde::__private228::Result<Self::Value, __E> where
__E: _serde::de::Error {
match __value {
b"id" => _serde::__private228::Ok(__Field::__field0),
b"login" => _serde::__private228::Ok(__Field::__field1),
b"github_id" => _serde::__private228::Ok(__Field::__field2),
b"name" => _serde::__private228::Ok(__Field::__field3),
b"avatar" => _serde::__private228::Ok(__Field::__field4),
b"org_id" => _serde::__private228::Ok(__Field::__field5),
_ => {
let __value =
&_serde::__private228::from_utf8_lossy(__value);
_serde::__private228::Err(_serde::de::Error::unknown_field(__value,
FIELDS))
}
}
}
}
#[automatically_derived]
impl<'de> _serde::Deserialize<'de> for __Field {
#[inline]
fn deserialize<__D>(__deserializer: __D)
-> _serde::__private228::Result<Self, __D::Error> where
__D: _serde::Deserializer<'de> {
_serde::Deserializer::deserialize_identifier(__deserializer,
__FieldVisitor)
}
}
#[doc(hidden)]
struct __Visitor<'de> {
marker: _serde::__private228::PhantomData<Row>,
lifetime: _serde::__private228::PhantomData<&'de ()>,
}
#[automatically_derived]
impl<'de> _serde::de::Visitor<'de> for __Visitor<'de> {
type Value = Row;
fn expecting(&self,
__formatter: &mut _serde::__private228::Formatter)
-> _serde::__private228::fmt::Result {
_serde::__private228::Formatter::write_str(__formatter,
"struct Row")
}
#[inline]
fn visit_seq<__A>(self, mut __seq: __A)
-> _serde::__private228::Result<Self::Value, __A::Error>
where __A: _serde::de::SeqAccess<'de> {
let __field0 =
match _serde::de::SeqAccess::next_element::<TeamId>(&mut __seq)?
{
_serde::__private228::Some(__value) => __value,
_serde::__private228::None =>
return _serde::__private228::Err(_serde::de::Error::invalid_length(0usize,
&"struct Row with 6 elements")),
};
let __field1 =
match _serde::de::SeqAccess::next_element::<String>(&mut __seq)?
{
_serde::__private228::Some(__value) => __value,
_serde::__private228::None =>
return _serde::__private228::Err(_serde::de::Error::invalid_length(1usize,
&"struct Row with 6 elements")),
};
let __field2 =
match _serde::de::SeqAccess::next_element::<u32>(&mut __seq)?
{
_serde::__private228::Some(__value) => __value,
_serde::__private228::None =>
return _serde::__private228::Err(_serde::de::Error::invalid_length(2usize,
&"struct Row with 6 elements")),
};
let __field3 =
match _serde::de::SeqAccess::next_element::<String>(&mut __seq)?
{
_serde::__private228::Some(__value) => __value,
_serde::__private228::None =>
return _serde::__private228::Err(_serde::de::Error::invalid_length(3usize,
&"struct Row with 6 elements")),
};
let __field4 =
match _serde::de::SeqAccess::next_element::<String>(&mut __seq)?
{
_serde::__private228::Some(__value) => __value,
_serde::__private228::None =>
return _serde::__private228::Err(_serde::de::Error::invalid_length(4usize,
&"struct Row with 6 elements")),
};
let __field5 =
match _serde::de::SeqAccess::next_element::<Option<u32>>(&mut __seq)?
{
_serde::__private228::Some(__value) => __value,
_serde::__private228::None =>
return _serde::__private228::Err(_serde::de::Error::invalid_length(5usize,
&"struct Row with 6 elements")),
};
_serde::__private228::Ok(Row {
id: __field0,
login: __field1,
github_id: __field2,
name: __field3,
avatar: __field4,
org_id: __field5,
})
}
#[inline]
fn visit_map<__A>(self, mut __map: __A)
-> _serde::__private228::Result<Self::Value, __A::Error>
where __A: _serde::de::MapAccess<'de> {
let mut __field0: _serde::__private228::Option<TeamId> =
_serde::__private228::None;
let mut __field1: _serde::__private228::Option<String> =
_serde::__private228::None;
let mut __field2: _serde::__private228::Option<u32> =
_serde::__private228::None;
let mut __field3: _serde::__private228::Option<String> =
_serde::__private228::None;
let mut __field4: _serde::__private228::Option<String> =
_serde::__private228::None;
let mut __field5:
_serde::__private228::Option<Option<u32>> =
_serde::__private228::None;
while let _serde::__private228::Some(__key) =
_serde::de::MapAccess::next_key::<__Field>(&mut __map)? {
match __key {
__Field::__field0 => {
if _serde::__private228::Option::is_some(&__field0) {
return _serde::__private228::Err(<__A::Error as
_serde::de::Error>::duplicate_field("id"));
}
__field0 =
_serde::__private228::Some(_serde::de::MapAccess::next_value::<TeamId>(&mut __map)?);
}
__Field::__field1 => {
if _serde::__private228::Option::is_some(&__field1) {
return _serde::__private228::Err(<__A::Error as
_serde::de::Error>::duplicate_field("login"));
}
__field1 =
_serde::__private228::Some(_serde::de::MapAccess::next_value::<String>(&mut __map)?);
}
__Field::__field2 => {
if _serde::__private228::Option::is_some(&__field2) {
return _serde::__private228::Err(<__A::Error as
_serde::de::Error>::duplicate_field("github_id"));
}
__field2 =
_serde::__private228::Some(_serde::de::MapAccess::next_value::<u32>(&mut __map)?);
}
__Field::__field3 => {
if _serde::__private228::Option::is_some(&__field3) {
return _serde::__private228::Err(<__A::Error as
_serde::de::Error>::duplicate_field("name"));
}
__field3 =
_serde::__private228::Some(_serde::de::MapAccess::next_value::<String>(&mut __map)?);
}
__Field::__field4 => {
if _serde::__private228::Option::is_some(&__field4) {
return _serde::__private228::Err(<__A::Error as
_serde::de::Error>::duplicate_field("avatar"));
}
__field4 =
_serde::__private228::Some(_serde::de::MapAccess::next_value::<String>(&mut __map)?);
}
__Field::__field5 => {
if _serde::__private228::Option::is_some(&__field5) {
return _serde::__private228::Err(<__A::Error as
_serde::de::Error>::duplicate_field("org_id"));
}
__field5 =
_serde::__private228::Some(_serde::de::MapAccess::next_value::<Option<u32>>(&mut __map)?);
}
}
}
let __field0 =
match __field0 {
_serde::__private228::Some(__field0) => __field0,
_serde::__private228::None =>
_serde::__private228::de::missing_field("id")?,
};
let __field1 =
match __field1 {
_serde::__private228::Some(__field1) => __field1,
_serde::__private228::None =>
_serde::__private228::de::missing_field("login")?,
};
let __field2 =
match __field2 {
_serde::__private228::Some(__field2) => __field2,
_serde::__private228::None =>
_serde::__private228::de::missing_field("github_id")?,
};
let __field3 =
match __field3 {
_serde::__private228::Some(__field3) => __field3,
_serde::__private228::None =>
_serde::__private228::de::missing_field("name")?,
};
let __field4 =
match __field4 {
_serde::__private228::Some(__field4) => __field4,
_serde::__private228::None =>
_serde::__private228::de::missing_field("avatar")?,
};
let __field5 =
match __field5 {
_serde::__private228::Some(__field5) => __field5,
_serde::__private228::None =>
_serde::__private228::de::missing_field("org_id")?,
};
_serde::__private228::Ok(Row {
id: __field0,
login: __field1,
github_id: __field2,
name: __field3,
avatar: __field4,
org_id: __field5,
})
}
}
#[doc(hidden)]
const FIELDS: &'static [&'static str] =
&["id", "login", "github_id", "name", "avatar", "org_id"];
_serde::Deserializer::deserialize_struct(__deserializer,
"Row", FIELDS,
__Visitor {
marker: _serde::__private228::PhantomData::<Row>,
lifetime: _serde::__private228::PhantomData,
})
}
}
};Deserialize, #[automatically_derived]
impl ::core::clone::Clone for Row {
#[inline]
fn clone(&self) -> Row {
Row {
id: ::core::clone::Clone::clone(&self.id),
login: ::core::clone::Clone::clone(&self.login),
github_id: ::core::clone::Clone::clone(&self.github_id),
name: ::core::clone::Clone::clone(&self.name),
avatar: ::core::clone::Clone::clone(&self.avatar),
org_id: ::core::clone::Clone::clone(&self.org_id),
}
}
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for Row {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
let names: &'static _ =
&["id", "login", "github_id", "name", "avatar", "org_id"];
let values: &[&dyn ::core::fmt::Debug] =
&[&self.id, &self.login, &self.github_id, &self.name,
&self.avatar, &&self.org_id];
::core::fmt::Formatter::debug_struct_fields_finish(f, "Row", names,
values)
}
}Debug)]
16#[serde(deny_unknown_fields)]
17#[non_exhaustive]
18pub struct Row {
19 pub id: TeamId,
21 pub login: String,
23 pub github_id: u32,
25 pub name: String,
26 pub avatar: String,
27 pub org_id: Option<u32>,
28}
29
30impl Ord for Row {
31 fn cmp(&self, other: &Self) -> Ordering {
32 TeamId::cmp(&self.id, &other.id)
33 }
34}
35
36impl PartialOrd for Row {
37 fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
38 Some(self.cmp(other))
39 }
40}
41
42impl Eq for Row {}
43
44impl PartialEq for Row {
45 fn eq(&self, other: &Self) -> bool {
46 TeamId::eq(&self.id, &other.id)
47 }
48}
49
50impl Hash for Row {
51 fn hash<H: Hasher>(&self, state: &mut H) {
52 TeamId::hash(&self.id, state);
53 }
54}
55
56impl Borrow<TeamId> for Row {
57 fn borrow(&self) -> &TeamId {
58 &self.id
59 }
60}