g1t/crates/contracts/src/lib.rs

25 lines693 bytesCodeBlame

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

API and MCP server, Rust identity service, registration, site redesign1//! Types and service interfaces shared by every g1t service.
2//!
3//! Each service has a module here holding the data it exchanges and the
4//! arguments of each of its methods. Services and their callers depend on
5//! this crate, never on each other's code.
6
7pub mod identity;
8mod ids;
9mod names;
10mod outcome;
11
12pub use ids::new_id;
13pub use names::{is_valid_namespace, is_valid_repo_name};
14pub use outcome::{Failure, FailureCode, Outcome};
15
16use serde::{Deserialize, Serialize};
17
18#[derive(Clone, Debug, Serialize, Deserialize)]
19pub struct User {
20 pub id: String,
21 pub username: String,
22}
23
24/// Who is asking. Every read and write in every service takes one.
25pub type Viewer = Option<User>;