// (C) Copyright 2026- ECMWF and individual contributors.
//
// This software is licensed under the terms of the Apache Licence Version 2.0
// which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
// In applying this licence, ECMWF does not waive the privileges and immunities
// granted to it by virtue of its status as an intergovernmental organisation nor
// does it submit to any jurisdiction.

pub mod decode;
pub mod dtype;
pub mod encode;
pub mod error;
pub mod file;
pub mod framing;
pub mod hash;
pub mod iter;
pub mod metadata;
// Internal thread-dispatch helpers for the multi-threaded coding
// pipeline.  Callers configure threading via `EncodeOptions.threads`
// and `DecodeOptions.threads`; the constants
// `DEFAULT_PARALLEL_THRESHOLD_BYTES` and `ENV_THREADS` are re-exported
// at the crate root for documentation.
mod parallel;
pub mod pipeline;
#[cfg(feature = "remote")]
pub mod remote;
pub mod streaming;
pub(crate) mod strict_finite;
pub mod types;
pub mod validate;
pub mod wire;

pub use decode::{
    DecodeOptions, decode, decode_descriptors, decode_metadata, decode_object, decode_range,
    decode_range_from_payload,
};
pub use dtype::Dtype;
pub use encode::{EncodeOptions, encode, encode_pre_encoded};
pub use error::{Result, TensogramError};
pub use file::TensogramFile;
pub use framing::{scan, scan_file};
pub use hash::{HashAlgorithm, compute_hash, verify_hash};
pub use iter::{FileMessageIter, MessageIter, ObjectIter, messages, objects, objects_metadata};
pub use metadata::{RESERVED_KEY, compute_common, verify_canonical_cbor};
pub use parallel::{DEFAULT_PARALLEL_THRESHOLD_BYTES, ENV_THREADS};
pub use pipeline::{DataPipeline, apply_pipeline};
pub use streaming::StreamingEncoder;
pub use tensogram_encodings::pipeline::CompressionBackend;
pub use types::{
    ByteOrder, DataObjectDescriptor, DecodedObject, GlobalMetadata, HashDescriptor, HashFrame,
    IndexFrame,
};
pub use validate::{
    FileIssue, FileValidationReport, IssueCode, IssueSeverity, ValidateOptions, ValidationIssue,
    ValidationLevel, ValidationReport, validate_buffer, validate_file, validate_message,
};
pub use wire::{FrameType, MessageFlags};

#[cfg(feature = "remote")]
pub use remote::is_remote_url;
