pub struct OscNode {
pub full_path: String,
pub contents: HashMap<String, OscNode>,
pub type: Option<OscTypeTag>,
pub description: Option<String>,
pub access: AccessMode,
pub value: Option<Vec<OscValue>>,
pub range: Option<Vec<RangeInfo>>,
}Expand description
Represents a single node in the OSC address space. It can be a container for other nodes or an endpoint with a value.
Fields§
§full_path: StringThe full OSC address path of the node (e.g., “/avatar/parameters/SomeParameter”). Required.
contents: HashMap<String, OscNode>A map of child nodes, if this node is a container (i.e., not an endpoint). Key is the child node’s name (one segment of the path).
type: Option<OscTypeTag>The OSC type tag string for this node (e.g., “f” for float, “i” for int). See OSC 1.0 specification for type tags.
description: Option<String>A human-readable description of this node.
access: AccessModeThe access mode of this node (read-only, write-only, or read-write).
Defaults to AccessMode::None if not specified.
value: Option<Vec<OscValue>>The current value(s) of this node, if it’s an endpoint. Can be a vector to support OSC messages with multiple arguments.
range: Option<Vec<RangeInfo>>The range of acceptable values for this node, if applicable.
Each RangeInfo can specify min/max or a list of allowed values.
Implementations§
Source§impl OscNode
impl OscNode
Sourcepub fn is_type(&self, expected_type: &OscType) -> bool
pub fn is_type(&self, expected_type: &OscType) -> bool
Checks if the node’s OSC type tag matches a specific single type.
Sourcepub fn is_boolean_type(&self) -> bool
pub fn is_boolean_type(&self) -> bool
Checks if the node’s OSC type tag represents a boolean.
Sourcepub fn get_single_osc_type(&self) -> Option<&OscType>
pub fn get_single_osc_type(&self) -> Option<&OscType>
Gets the single OscType if the node has exactly one type specified.