#[non_exhaustive]pub struct StreamData {
pub stream_id: i32,
pub contents: Option<Contents>,
/* private fields */
}Expand description
Data for a stream.
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.stream_id: i32Required. The unique ID of this stream, assigned by the client.
contents: Option<Contents>The data of the stream, either bytes or “Close”, indicating that the stream is done.
Implementations§
Source§impl StreamData
impl StreamData
pub fn new() -> Self
Sourcepub fn set_stream_id<T: Into<i32>>(self, v: T) -> Self
pub fn set_stream_id<T: Into<i32>>(self, v: T) -> 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
Sourcepub fn data(&self) -> Option<&Bytes>
pub fn data(&self) -> Option<&Bytes>
The value of contents
if it holds a Data, None if the field is not set or
holds a different branch.
Sourcepub fn close(&self) -> Option<&Box<Close>>
pub fn close(&self) -> Option<&Box<Close>>
The value of contents
if it holds a Close, None if the field is not set or
holds a different branch.
Sourcepub fn set_close<T: Into<Box<Close>>>(self, v: T) -> Self
pub fn set_close<T: Into<Box<Close>>>(self, v: T) -> Self
Sets the value of contents
to hold a Close.
Note that all the setters affecting contents are
mutually exclusive.
§Example
ⓘ
use google_cloud_devicestreaming_v1::model::Close;
let x = StreamData::new().set_close(Close::default()/* use setters */);
assert!(x.close().is_some());
assert!(x.data().is_none());Trait Implementations§
Source§impl Clone for StreamData
impl Clone for StreamData
Source§fn clone(&self) -> StreamData
fn clone(&self) -> StreamData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StreamData
impl Debug for StreamData
Source§impl Default for StreamData
impl Default for StreamData
Source§fn default() -> StreamData
fn default() -> StreamData
Returns the “default value” for a type. Read more
Source§impl PartialEq for StreamData
impl PartialEq for StreamData
impl StructuralPartialEq for StreamData
Auto Trait Implementations§
impl !Freeze for StreamData
impl RefUnwindSafe for StreamData
impl Send for StreamData
impl Sync for StreamData
impl Unpin for StreamData
impl UnwindSafe for StreamData
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