Skip to main content

aws_sdk_ec2/types/
_media_accelerator_info.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes the media accelerators for the instance type.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct MediaAcceleratorInfo {
7    /// <p>Describes the media accelerators for the instance type.</p>
8    pub accelerators: ::std::option::Option<::std::vec::Vec<crate::types::MediaDeviceInfo>>,
9    /// <p>The total size of the memory for the media accelerators for the instance type, in MiB.</p>
10    pub total_media_memory_in_mib: ::std::option::Option<i32>,
11}
12impl MediaAcceleratorInfo {
13    /// <p>Describes the media accelerators for the instance type.</p>
14    ///
15    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.accelerators.is_none()`.
16    pub fn accelerators(&self) -> &[crate::types::MediaDeviceInfo] {
17        self.accelerators.as_deref().unwrap_or_default()
18    }
19    /// <p>The total size of the memory for the media accelerators for the instance type, in MiB.</p>
20    pub fn total_media_memory_in_mib(&self) -> ::std::option::Option<i32> {
21        self.total_media_memory_in_mib
22    }
23}
24impl MediaAcceleratorInfo {
25    /// Creates a new builder-style object to manufacture [`MediaAcceleratorInfo`](crate::types::MediaAcceleratorInfo).
26    pub fn builder() -> crate::types::builders::MediaAcceleratorInfoBuilder {
27        crate::types::builders::MediaAcceleratorInfoBuilder::default()
28    }
29}
30
31/// A builder for [`MediaAcceleratorInfo`](crate::types::MediaAcceleratorInfo).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct MediaAcceleratorInfoBuilder {
35    pub(crate) accelerators: ::std::option::Option<::std::vec::Vec<crate::types::MediaDeviceInfo>>,
36    pub(crate) total_media_memory_in_mib: ::std::option::Option<i32>,
37}
38impl MediaAcceleratorInfoBuilder {
39    /// Appends an item to `accelerators`.
40    ///
41    /// To override the contents of this collection use [`set_accelerators`](Self::set_accelerators).
42    ///
43    /// <p>Describes the media accelerators for the instance type.</p>
44    pub fn accelerators(mut self, input: crate::types::MediaDeviceInfo) -> Self {
45        let mut v = self.accelerators.unwrap_or_default();
46        v.push(input);
47        self.accelerators = ::std::option::Option::Some(v);
48        self
49    }
50    /// <p>Describes the media accelerators for the instance type.</p>
51    pub fn set_accelerators(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MediaDeviceInfo>>) -> Self {
52        self.accelerators = input;
53        self
54    }
55    /// <p>Describes the media accelerators for the instance type.</p>
56    pub fn get_accelerators(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MediaDeviceInfo>> {
57        &self.accelerators
58    }
59    /// <p>The total size of the memory for the media accelerators for the instance type, in MiB.</p>
60    pub fn total_media_memory_in_mib(mut self, input: i32) -> Self {
61        self.total_media_memory_in_mib = ::std::option::Option::Some(input);
62        self
63    }
64    /// <p>The total size of the memory for the media accelerators for the instance type, in MiB.</p>
65    pub fn set_total_media_memory_in_mib(mut self, input: ::std::option::Option<i32>) -> Self {
66        self.total_media_memory_in_mib = input;
67        self
68    }
69    /// <p>The total size of the memory for the media accelerators for the instance type, in MiB.</p>
70    pub fn get_total_media_memory_in_mib(&self) -> &::std::option::Option<i32> {
71        &self.total_media_memory_in_mib
72    }
73    /// Consumes the builder and constructs a [`MediaAcceleratorInfo`](crate::types::MediaAcceleratorInfo).
74    pub fn build(self) -> crate::types::MediaAcceleratorInfo {
75        crate::types::MediaAcceleratorInfo {
76            accelerators: self.accelerators,
77            total_media_memory_in_mib: self.total_media_memory_in_mib,
78        }
79    }
80}