INNER CODE UNIT · Rust

extract_namespace

databricks/click · src/command/mod.rs:317

pub fn extract_namespace<T: Metadata<Ty = ObjectMeta>>(obj: &T) -> Option<Cow<'_, str>> {
    let meta = obj.metadata();
    meta.namespace.as_ref().map(|ns| ns.as_str().into())
}

/// An extractor for the Labels field. Extracts the labels out of the object metadata
pub fn extract_labels<T: Metadata<Ty = ObjectMeta>>(obj: &T) -> Option<Cow<'_, str>> {
    let meta = obj.metadata();
    meta.labels
        .as_ref()
        .map(|labels| keyval_string(labels.iter(), None).into())
}

// utility functions
fn row_matches(row: &[CellSpec<'_>], regex: &Regex) -> bool {
    let mut has_match = false;
    for cell_spec in row.iter() {
        if !has_match {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…