in src/azure/client.rs [1028:1055]
fn to_list_result(value: ListResultInternal, prefix: Option<&str>) -> Result<ListResult> {
let prefix = prefix.unwrap_or_default();
let common_prefixes = value
.blobs
.blob_prefix
.into_iter()
.map(|x| Ok(Path::parse(x.name)?))
.collect::<Result<_>>()?;
let objects = value
.blobs
.blobs
.into_iter()
// Note: Filters out directories from list results when hierarchical namespaces are
// enabled. When we want directories, its always via the BlobPrefix mechanics,
// and during lists we state that prefixes are evaluated on path segment basis.
.filter(|blob| {
!matches!(blob.properties.resource_type.as_ref(), Some(typ) if typ == "directory")
&& blob.name.len() > prefix.len()
})
.map(ObjectMeta::try_from)
.collect::<Result<_>>()?;
Ok(ListResult {
common_prefixes,
objects,
})
}