pub struct CreateVolumeRequestBuilder { /* private fields */ }Implementations§
Source§impl CreateVolumeRequestBuilder
impl CreateVolumeRequestBuilder
pub fn new(name: String, region: MachineRegions, size_gb: u64) -> Self
pub fn encrypted(self, encrypted: bool) -> Self
pub fn fstype(self, fstype: String) -> Self
pub fn require_unique_zone(self, require_unique_zone: bool) -> Self
pub fn compute(self, compute: Compute) -> Self
pub fn snapshot_id(self, snapshot_id: Option<String>) -> Self
pub fn snapshot_retention(self, snapshot_retention: Option<u32>) -> Self
pub fn source_volume_id(self, source_volume_id: Option<String>) -> Self
Sourcepub fn build(self) -> CreateVolumeRequest
pub fn build(self) -> CreateVolumeRequest
Examples found in repository?
examples/volumes.rs (line 31)
6async fn main() -> Result<(), Box<dyn Error>> {
7 tracing_subscriber::registry()
8 .with(fmt::layer().with_writer(std::io::stdout))
9 .with(EnvFilter::new(
10 std::env::var("RUST_LOG").unwrap_or_else(|_| "info".into()),
11 ))
12 .init();
13 let api_token = std::env::var("FLY_ORG_TOKEN").expect("FLY_ORG_TOKEN must be set");
14 let args: Vec<String> = std::env::args().collect();
15 let org_slug = &args
16 .get(1)
17 .expect("Usage: cargo run --example apps <org_slug>");
18
19 let app_name = "rusty-app";
20 let fly = FlyControl::new(api_token.to_string());
21
22 fly.apps.create(app_name, org_slug).await?;
23
24 // VOLUMES
25 let vol_name = "test_volume";
26 let resp = fly
27 .volumes
28 .create_volume(
29 app_name,
30 volumes::CreateVolumeRequest::builder(vol_name, machines::MachineRegions::Ams, 10)
31 .build(),
32 )
33 .await?;
34 fly.volumes.list_volumes(app_name, false).await?;
35 let vol_id = resp.id.unwrap();
36 fly.volumes.destroy_volume(app_name, &vol_id).await?;
37 fly.apps.delete(app_name, false).await?;
38
39 Ok(())
40}Auto Trait Implementations§
impl Freeze for CreateVolumeRequestBuilder
impl RefUnwindSafe for CreateVolumeRequestBuilder
impl Send for CreateVolumeRequestBuilder
impl Sync for CreateVolumeRequestBuilder
impl Unpin for CreateVolumeRequestBuilder
impl UnwindSafe for CreateVolumeRequestBuilder
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