MCPcopy Index your code
hub / github.com/cargo-lambda/cargo-lambda / new

Method new

crates/cargo-lambda-deploy/src/dry.rs:135–174  ·  view source on GitHub ↗
(
        config: &Deploy,
        name: &str,
        sdk_config: &SdkConfig,
        archive: &BinaryArchive,
    )

Source from the content-addressed store, hash-verified

133
134impl DeployOutput {
135 pub(crate) fn new(
136 config: &Deploy,
137 name: &str,
138 sdk_config: &SdkConfig,
139 archive: &BinaryArchive,
140 ) -> Result<Self> {
141 let (kind, name, runtimes) = if config.extension {
142 (
143 DeployKind::Extension,
144 name.to_owned(),
145 config.compatible_runtimes(),
146 )
147 } else {
148 let binary_name = binary_name_or_default(config, name);
149 (DeployKind::Function, binary_name, vec![])
150 };
151
152 let display_sdk_config = DisplaySdkConfig {
153 region: sdk_config.region().map(|r| r.to_string()),
154 profile: config
155 .remote_config
156 .as_ref()
157 .and_then(|r| r.profile.clone()),
158 endpoint_url: sdk_config.endpoint_url().map(|u| u.to_string()),
159 };
160
161 Ok(DeployOutput {
162 kind,
163 name,
164 runtimes,
165 path: archive.path.clone(),
166 arch: archive.architecture.clone(),
167 bucket: config.s3_bucket.clone(),
168 tags: config.s3_tags(),
169 config: config.function_config.clone(),
170 sdk_config: display_sdk_config,
171 files: archive.list()?,
172 binary_modified_at: archive.binary_modified_at.clone(),
173 })
174 }
175}

Callers

nothing calls this directly

Calls 4

binary_name_or_defaultFunction · 0.85
compatible_runtimesMethod · 0.80
s3_tagsMethod · 0.80
listMethod · 0.80

Tested by

no test coverage detected