MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / with_metadata

Method with_metadata

atomic-core/src/output/repo/tree.rs:585–588  ·  view source on GitHub ↗

Set the metadata for this item. # Arguments `metadata` - File or directory metadata # Example ```rust,ignore use atomic_core::output::repo::TreeItem; use atomic_core::output::traits::FileMetadata; use atomic_core::types::{Inode, Position}; let item = TreeItem::file("script.sh", Inode::ROOT, Position::ROOT) .with_metadata(FileMetadata::executable()); assert!(item.metadata.is_executable()); ```

(mut self, metadata: FileMetadata)

Source from the content-addressed store, hash-verified

583 /// assert!(item.metadata.is_executable());
584 /// ```
585 pub fn with_metadata(mut self, metadata: FileMetadata) -> Self {
586 self.metadata = metadata;
587 self
588 }
589
590 /// Get the filename (last component of path).
591 ///

Callers 1

test_item_with_metadataFunction · 0.45

Calls

no outgoing calls

Tested by 1

test_item_with_metadataFunction · 0.36