#[non_exhaustive]pub struct DeviceMessage {
pub contents: Option<Contents>,
/* private fields */
}Expand description
A message returned from a device.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.contents: Option<Contents>Implementations§
Source§impl DeviceMessage
impl DeviceMessage
pub fn new() -> Self
Sourcepub fn set_contents<T: Into<Option<Contents>>>(self, v: T) -> Self
pub fn set_contents<T: Into<Option<Contents>>>(self, v: T) -> Self
Sets the value of contents.
Note that all the setters affecting contents are mutually
exclusive.
§Example
use google_cloud_devicestreaming_v1::model::StatusUpdate;
let x = DeviceMessage::new().set_contents(Some(
google_cloud_devicestreaming_v1::model::device_message::Contents::StatusUpdate(StatusUpdate::default().into())));Sourcepub fn status_update(&self) -> Option<&Box<StatusUpdate>>
pub fn status_update(&self) -> Option<&Box<StatusUpdate>>
The value of contents
if it holds a StatusUpdate, None if the field is not set or
holds a different branch.
Sourcepub fn set_status_update<T: Into<Box<StatusUpdate>>>(self, v: T) -> Self
pub fn set_status_update<T: Into<Box<StatusUpdate>>>(self, v: T) -> Self
Sets the value of contents
to hold a StatusUpdate.
Note that all the setters affecting contents are
mutually exclusive.
§Example
use google_cloud_devicestreaming_v1::model::StatusUpdate;
let x = DeviceMessage::new().set_status_update(StatusUpdate::default()/* use setters */);
assert!(x.status_update().is_some());
assert!(x.stream_status().is_none());
assert!(x.stream_data().is_none());Sourcepub fn stream_status(&self) -> Option<&Box<StreamStatus>>
pub fn stream_status(&self) -> Option<&Box<StreamStatus>>
The value of contents
if it holds a StreamStatus, None if the field is not set or
holds a different branch.
Sourcepub fn set_stream_status<T: Into<Box<StreamStatus>>>(self, v: T) -> Self
pub fn set_stream_status<T: Into<Box<StreamStatus>>>(self, v: T) -> Self
Sets the value of contents
to hold a StreamStatus.
Note that all the setters affecting contents are
mutually exclusive.
§Example
use google_cloud_devicestreaming_v1::model::StreamStatus;
let x = DeviceMessage::new().set_stream_status(StreamStatus::default()/* use setters */);
assert!(x.stream_status().is_some());
assert!(x.status_update().is_none());
assert!(x.stream_data().is_none());Sourcepub fn stream_data(&self) -> Option<&Box<StreamData>>
pub fn stream_data(&self) -> Option<&Box<StreamData>>
The value of contents
if it holds a StreamData, None if the field is not set or
holds a different branch.
Sourcepub fn set_stream_data<T: Into<Box<StreamData>>>(self, v: T) -> Self
pub fn set_stream_data<T: Into<Box<StreamData>>>(self, v: T) -> Self
Sets the value of contents
to hold a StreamData.
Note that all the setters affecting contents are
mutually exclusive.
§Example
use google_cloud_devicestreaming_v1::model::StreamData;
let x = DeviceMessage::new().set_stream_data(StreamData::default()/* use setters */);
assert!(x.stream_data().is_some());
assert!(x.status_update().is_none());
assert!(x.stream_status().is_none());Trait Implementations§
Source§impl Clone for DeviceMessage
impl Clone for DeviceMessage
Source§fn clone(&self) -> DeviceMessage
fn clone(&self) -> DeviceMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more