Sigil documentation
ReferenceRust referencesigil-labor-api

sigil-labor-api · handlers

Source declarations, signatures and documentation for handlers.

Source: sigil/node/../labor-api/src/handlers.rs. SHA-256: 1a000ed52979da1832dd164225f658c4b764aa501240ddeb32b51dea6ccb3199.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

handlers::AppState

Shared application state.

pub struct AppState {
pub store: Arc<dyn LaborStore>
}

Source line: 28.

handlers::health

pub async fn health() -> &'static str;

Source line: 36.

handlers::post_job

pub async fn post_job(
    State(state): State<Arc<AppState>>,
    Extension(auth): Extension<Arc<AuthDid>>,
    Json(req): Json<PostJobReq>,
) -> Result<impl IntoResponse, LaborError>;

Source line: 44.

handlers::list_jobs

pub async fn list_jobs(
    State(state): State<Arc<AppState>>,
    Query(params): Query<SearchParams>,
) -> Result<Json<Page<JobPosting>>, LaborError>;

Source line: 65.

handlers::get_job

pub async fn get_job(
    State(state): State<Arc<AppState>>,
    Path(id): Path<Uuid>,
) -> Result<Json<JobPosting>, LaborError>;

Source line: 91.

handlers::close_job

pub async fn close_job(
    State(state): State<Arc<AppState>>,
    Extension(auth): Extension<Arc<AuthDid>>,
    Path(id): Path<Uuid>,
) -> Result<Json<JobPosting>, LaborError>;

Source line: 103.

handlers::apply_to_job

pub async fn apply_to_job(
    State(state): State<Arc<AppState>>,
    Extension(auth): Extension<Arc<AuthDid>>,
    Path(job_id): Path<Uuid>,
    Json(req): Json<ApplyReq>,
) -> Result<impl IntoResponse, LaborError>;

Source line: 128.

handlers::get_applications

pub async fn get_applications(
    State(state): State<Arc<AppState>>,
    Path(job_id): Path<Uuid>,
    Query(params): Query<SearchParams>,
) -> Result<Json<Page<JobApplication>>, LaborError>;

Source line: 152.

handlers::create_contract

pub async fn create_contract(
    State(state): State<Arc<AppState>>,
    Extension(auth): Extension<Arc<AuthDid>>,
    Json(req): Json<CreateContractReq>,
) -> Result<impl IntoResponse, LaborError>;

Source line: 178.

handlers::get_contract

pub async fn get_contract(
    State(state): State<Arc<AppState>>,
    Path(id): Path<Uuid>,
) -> Result<Json<Contract>, LaborError>;

Source line: 210.

handlers::complete_contract

pub async fn complete_contract(
    State(state): State<Arc<AppState>>,
    Extension(auth): Extension<Arc<AuthDid>>,
    Path(id): Path<Uuid>,
) -> Result<Json<Contract>, LaborError>;

Source line: 222.

handlers::submit_review

pub async fn submit_review(
    State(state): State<Arc<AppState>>,
    Extension(_auth): Extension<Arc<AuthDid>>,
    Json(req): Json<SubmitReviewReq>,
) -> Result<impl IntoResponse, LaborError>;

Source line: 251.

handlers::get_reputation

pub async fn get_reputation(
    State(state): State<Arc<AppState>>,
    Path(agent_id): Path<String>,
) -> Result<Json<ReputationScore>, LaborError>;

Source line: 271.

On this page