feat: impl setup restoration

This commit is contained in:
2026-04-26 00:01:57 +01:00
parent a54cc84660
commit 8b28f3d67f
11 changed files with 397 additions and 130 deletions

View File

@@ -1,18 +1,45 @@
use std::ops::Deref;
use reqwest::Method;
use serde::Deserialize;
use serde::{Deserialize, Serialize};
use crate::{api, query};
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(transparent)]
#[repr(transparent)]
pub struct Id(u64);
#[derive(Debug, Deserialize)]
pub struct User {
pub login: String,
pub id: u64,
pub id: Id,
pub avatar_url: String,
pub html_url: String,
pub name: Option<String>,
pub email: Option<String>,
}
impl Deref for Id {
type Target = u64;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<u64> for Id {
fn from(id: u64) -> Self {
Self(id)
}
}
impl std::fmt::Display for Id {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.0.fmt(f)
}
}
#[derive(Clone)]
pub struct Fetch;