Skip to main content

conduit_rs/
lib.rs

1//! Official Rust SDK for the Conduit API.
2//!
3//! `Conduit` exposes four stable resource groups:
4//!
5//! - [`Conduit::reports`] for report generation and retrieval
6//! - [`Conduit::matching`] for matching jobs and results
7//! - [`Conduit::webhooks`] for webhook signature verification and event parsing
8//! - [`Conduit::primitives`] for advanced access to media, jobs, and entities
9//!
10//! The primary production path is webhook-first: create a report or matching job, persist the
11//! returned receipt, then react to a verified webhook when the job reaches a terminal state.
12//! [`ReportHandle`] and [`MatchingHandle`] provide polling helpers for scripts and local tools.
13
14#![deny(missing_docs)]
15#![deny(
16    rustdoc::bare_urls,
17    rustdoc::broken_intra_doc_links,
18    rustdoc::invalid_rust_codeblocks
19)]
20
21mod client;
22mod common;
23mod error;
24/// Matching workflow types and resource methods.
25pub mod matching;
26/// Typed response models returned by the SDK.
27pub mod model;
28/// Advanced low-level media, jobs, and entities resources.
29pub mod primitives;
30/// Report workflow types and resource methods.
31pub mod reports;
32mod transport;
33/// Webhook verification and typed event parsing.
34pub mod webhooks;
35
36/// Top-level API client.
37pub use client::{Conduit, ConduitBuilder, DEFAULT_MAX_SOURCE_BYTES};
38/// Shared SDK error type and result alias.
39pub use error::{ConduitError as Error, Result};
40/// Matching workflow request, receipt, and handle types.
41pub use matching::{
42    MatchingContext, MatchingCreate, MatchingHandle, MatchingReceipt, MatchingResource, SubjectRef,
43};
44/// Common response models returned by Conduit resources.
45pub use model::{
46    CreditReservationStatus, Entity, FileDeleteReceipt, Job, JobCreditReservation, JobErrorData,
47    JobEvent, JobEventKind, JobKind, JobStage, JobStatus, ListEntitiesResponse, ListFilesResponse,
48    Matching, MatchingOutputData, MatchingResolvedSubject, MediaFile, MediaObject, MediaRetention,
49    ReceiptStatus, Report, ReportOutputData, RetentionLockResult, Usage,
50};
51/// Advanced primitives and shared polling/source types.
52pub use primitives::{
53    ActionOptions, EntitiesResource, JobsResource, MediaResource, PrimitivesResource, Source,
54    StreamOptions, WaitOptions,
55};
56/// Report workflow request, receipt, and target configuration types.
57pub use reports::{
58    OnMiss, ReportCreate, ReportHandle, ReportReceipt, ReportTemplate, ReportsResource, Target,
59    WebhookEndpoint,
60};
61/// Webhook event and verification types.
62pub use webhooks::{
63    MatchingCompletedEvent, MatchingFailedEvent, ReportCompletedEvent, ReportFailedEvent,
64    UnknownWebhookEvent, WebhookEvent, WebhookFailure, WebhooksResource,
65};