Device Detection and IP Intelligence for the 51Degrees Pipeline, in Rust

dd-cloud-native-model.rs File Reference

Classes

struct  ExampleOptions
 Options the example runs with. More...

Functions

pub struct ExampleOptions with_resource_key (resource_key:String) -> Self
 Default options for a resource key: the two sample native model names and the cloud endpoint from the environment, or the public cloud when unset.
pub fn run (options:ExampleOptions) -> Result<()>
 Run the cloud native-model lookup example.
fn main () -> Result<()>
 Read the resource key from the command line or the environment, then run.
fn profile_line_renders_vendor_name_model ()
fn profile_line_falls_back_to_unknown ()
fn runs_against_the_cloud ()

Variables

const FIND_OUT_MORE
 The links the example's output ends with.
const & str
const EVIDENCE_QUERY_NATIVE_MODEL_KEY
 The cloud evidence key a native model name is supplied under, query.nativemodel.
const SAMPLE_NATIVE_MODELS
 The two sample native model names the example looks up (an Android and an iOS model identifier).
pub resource_key
 The cloud resource key. Native model lookup requires a paid subscription.
pub pub endpoint
 An optional override for the cloud endpoint.
pub pub pub native_models
 The native model names to look up. Defaults to [SAMPLE_NATIVE_MODELS].
mod tests

Function Documentation

◆ main()

fn main ( ) -> Result<()>

Read the resource key from the command line or the environment, then run.

◆ profile_line_falls_back_to_unknown()

fn profile_line_falls_back_to_unknown ( )

◆ profile_line_renders_vendor_name_model()

fn profile_line_renders_vendor_name_model ( )

◆ run()

pub fn run ( options:ExampleOptions ) -> Result<()>

Run the cloud native-model lookup example.

A native model name (the value a device reports about itself, for example iPhone11,8) can match several device profiles. The pipeline carries a hardware-profile cloud engine, which exposes the matches under [HARDWARE_DATA_KEY] as a list of device profiles.

◆ runs_against_the_cloud()

fn runs_against_the_cloud ( )

◆ with_resource_key()

pub struct ExampleOptions with_resource_key ( resource_key:String ) -> Self

Default options for a resource key: the two sample native model names and the cloud endpoint from the environment, or the public cloud when unset.

Variable Documentation

◆ endpoint

pub pub endpoint

An optional override for the cloud endpoint.

◆ EVIDENCE_QUERY_NATIVE_MODEL_KEY

const EVIDENCE_QUERY_NATIVE_MODEL_KEY

The cloud evidence key a native model name is supplied under, query.nativemodel.

The native model name is an input-only value, supplied as evidence and never returned.

◆ FIND_OUT_MORE

const FIND_OUT_MORE

The links the example's output ends with.

◆ native_models

pub pub pub native_models

The native model names to look up. Defaults to [SAMPLE_NATIVE_MODELS].

◆ resource_key

pub resource_key

The cloud resource key. Native model lookup requires a paid subscription.

◆ SAMPLE_NATIVE_MODELS

const SAMPLE_NATIVE_MODELS

The two sample native model names the example looks up (an Android and an iOS model identifier).

◆ str

const & str
Initial value:
= &[
("Device Detection", "/device-detection?utm_source=code&utm_medium=example&utm_campaign=51degrees-rust&utm_content=examples-device-detection-examples-src-bin-dd-cloud-native-model.rs&utm_term=find-out-more"),
("Pricing", "/pricing?utm_source=code&utm_medium=example&utm_campaign=51degrees-rust&utm_content=examples-device-detection-examples-src-bin-dd-cloud-native-model.rs&utm_term=find-out-more"),
("Documentation", "/documentation/index.html?utm_source=code&utm_medium=example&utm_campaign=51degrees-rust&utm_content=examples-device-detection-examples-src-bin-dd-cloud-native-model.rs&utm_term=find-out-more"),
]

◆ tests

mod tests
Initial value:
{
use super::*