Function serde_rosmsg::from_str
[−]
[src]
pub fn from_str<T>(value: &str) -> Result<T> where T: Deserialize
Deserialize an instance of type T
from a string of ROSMSG data.
This conversion can fail if the passed stream of bytes does not match the
structure expected by T
. It can also fail if the structure contains
unsupported elements.
Examples
let value: String = from_str("\x11\0\0\0\x0d\0\0\0Hello, World!").unwrap(); assert_eq!(value, "Hello, World!"); let value: (u16, u16) = from_str("\x04\0\0\0\x02\x04\x08\x10").unwrap(); assert_eq!(value, (1026, 4104));