pub struct AdvancedConfig(/* private fields */);Expand description
The JSON configuration of one Advanced SDK object.
The SDK accepts a JSON document when it creates a sender, receiver, finder
and several other objects; the document’s properties are defined by the
NDI Advanced SDK documentation. This type holds one such document: it is
checked to be a JSON object, kept byte for byte (unknown properties
included), immutable, and cheap to clone. Most objects take it through an
options value’s config setter, such as
SenderOptions::config.
Genlock uses GenlockOptions::config.
A configuration can carry vendor credentials or network details, so its
Debug output shows no content and no error message quotes it.
§Examples
use grafton_ndi::advanced::AdvancedConfig;
let config = AdvancedConfig::parse(r#"{"ndi": {"machinename": "studio-a"}}"#)?;
assert_eq!(format!("{config:?}"), "AdvancedConfig([REDACTED])");Implementations§
Source§impl AdvancedConfig
impl AdvancedConfig
Sourcepub fn parse(json: impl AsRef<str>) -> Result<Self>
pub fn parse(json: impl AsRef<str>) -> Result<Self>
Accept a JSON object of at most one mebibyte.
§Errors
Error::InvalidInput when the text is too large, is not
valid JSON (including a raw NUL byte), or is not an object.
Sourcepub fn expose_json(&self) -> &str
pub fn expose_json(&self) -> &str
The JSON text exactly as it was given. It may contain vendor credentials or network details; the name is a reminder not to log it.