gproxy_protocol/transform/
mod.rs1pub mod compact;
8pub mod count_tokens;
9pub mod embeddings;
10mod error;
11pub mod files;
12pub mod generate;
13pub mod guardian;
14pub mod identity;
15pub mod images;
16mod instructions;
17pub mod memory;
18pub mod models;
19pub mod video;
20pub mod web_search;
21
22pub use error::{Diagnostic, DiagnosticKind, Report, TransformError, TransformErrorKind};
23
24pub(crate) fn optional<T>(value: Result<T, TransformError>) -> Result<Option<T>, TransformError> {
27 match value {
28 Ok(value) => Ok(Some(value)),
29 Err(error)
30 if matches!(
31 error.kind(),
32 TransformErrorKind::Unsupported | TransformErrorKind::MissingMetadata
33 ) =>
34 {
35 Ok(None)
36 }
37 Err(error) => Err(error),
38 }
39}
40
41#[derive(Debug, Clone, PartialEq, Eq)]
44pub struct Converted<T> {
45 pub value: T,
46 pub report: Report,
47}