#[non_exhaustive]pub struct Json {
pub tracks: BTreeMap<String, JsonConfig>,
}Expand description
The JSON tracks a broadcast publishes, keyed by track name.
These are application data tracks, not media: a chat log, a telemetry feed, a status document.
Each entry says how to read the track (its mode) without a consumer having to
know the application.
Marked #[non_exhaustive] so additional optional fields can be added without bumping the major
version. External callers start from Json::default and fill in what they need
(insert); struct-literal construction is not available outside this crate.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.tracks: BTreeMap<String, JsonConfig>A map of track name to configuration.
A map rather than an array so it works with JSON Merge Patch, and a BTreeMap so keys are
sorted for some deterministic behavior.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Json
impl<'de> Deserialize<'de> for Json
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Json
Auto Trait Implementations§
impl Freeze for Json
impl RefUnwindSafe for Json
impl Send for Json
impl Sync for Json
impl Unpin for Json
impl UnsafeUnpin for Json
impl UnwindSafe for Json
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more