pub struct GhKey {
pub id: u64,
pub key: String,
}
Expand description
GitHub API response parsing struct (REST v3)
URL: GET https://api.github.com/user/<USERNAME>/keys
§Example
use superkeyloader_lib::github::GhKey;
let json_string = r#"
[
{
"id": 12257919,
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCarT/me5sWxY9Tizc"
},
{
"id": 22932337,
"key": "ssh-rsa AAAAB3N"
}
]
"#;
let parsed_json = serde_json::from_str(&json_string);
let keys: Vec<GhKey> = parsed_json.unwrap();
assert_eq!(keys[0].id, 12257919);
assert_eq!(keys[1].key, "ssh-rsa AAAAB3N");
Fields§
§id: u64
§key: String
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GhKey
impl<'de> Deserialize<'de> for GhKey
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GhKey
impl RefUnwindSafe for GhKey
impl Send for GhKey
impl Sync for GhKey
impl Unpin for GhKey
impl UnwindSafe for GhKey
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