MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / docker_tmpfs_option

Function docker_tmpfs_option

crates/openshell-driver-docker/src/lib.rs:2005–2024  ·  view source on GitHub ↗
(option: &str)

Source from the content-addressed store, hash-verified

2003}
2004
2005fn docker_tmpfs_option(option: &str) -> Result<Vec<String>, Status> {
2006 let option = option.trim();
2007 if option.is_empty() {
2008 return Err(Status::failed_precondition(
2009 "tmpfs options must not contain empty values",
2010 ));
2011 }
2012 if let Some((key, value)) = option.split_once('=') {
2013 let key = key.trim();
2014 let value = value.trim();
2015 if key.is_empty() || value.is_empty() {
2016 return Err(Status::failed_precondition(
2017 "tmpfs key=value options must include both key and value",
2018 ));
2019 }
2020 Ok(vec![key.to_string(), value.to_string()])
2021 } else {
2022 Ok(vec![option.to_string()])
2023 }
2024}
2025
2026fn docker_volume_is_bind_backed(volume: &bollard::models::Volume) -> bool {
2027 volume.driver == "local"

Callers 2

docker_mount_from_configFunction · 0.85

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected