OptrisOptrisDocumentation

Documentation/OTC SDK/optris_sdk — Rust API referencev12.0

user_agent — functions and constants

The User-Agent of the SDK's calibration downloads.

Every request the SDK makes to the Optris calibration server carries OTC.SDK/<version> (<binding>; <os>; <arch>), so the server's log shows which SDK releases and bindings are in use. This crate names itself rust there (name_binding), and an application may add its own name (set_application_info).

pub fn set_application_info(name: &str, version: &str) -> Result<()>

Name the application in the SDK's calibration download requests.

Every request the SDK makes to the Optris calibration server carries OTC.SDK/<version> (rust; <os>; <arch>), for example OTC.SDK/12.0.44 (rust; linux; x86_64), so the server's log shows which SDK releases and bindings are in use. Nothing in it identifies a machine, a user or a camera. This appends <name>/<version> to it for every request made after the call.

Optional: without it, nothing is appended. The token ends up in the calibration server's logs and nowhere else. Process-wide, and safe to call from any thread at any time.

name is 1 to 64 letters, digits and the punctuation an HTTP token allows (!#$%&'*+-.^_|~ and the backquote), with no space or slash; version follows the same rules, 1 to 32 characters. An empty name removes the token, whatever version says.

Examples

optris_sdk::set_application_info("MyInspector", "2.0.5")?;
# optris_sdk::set_application_info("", "")?;
# Ok::<(), optris_sdk::Error>(())

Errors

crate::Status::InvalidArgument for a name or version that breaks those rules; the token in effect stays as it was.