pub struct AtomicChunk {Show 20 fields
pub chunk_id: String,
pub aliases: Vec<ChunkAlias>,
pub name: String,
pub description: Option<String>,
pub language: String,
pub granularity: ChunkGranularity,
pub categories: Vec<ChunkCategory>,
pub tags: Vec<String>,
pub concepts: Vec<String>,
pub provides: Vec<String>,
pub requires: Vec<String>,
pub platform: PlatformConstraint,
pub composition: ChunkComposition,
pub metrics: ChunkMetrics,
pub sources: Vec<SourceLocation>,
pub content_hash: String,
pub size: usize,
pub license: String,
pub created_at: Option<String>,
pub version: Option<String>,
}Expand description
An atomic chunk - the fundamental unit of reusable code
Fields§
§chunk_id: StringContent-addressed chunk ID (chunk:sha256:…)
aliases: Vec<ChunkAlias>Human-readable aliases for this chunk
name: StringName of the chunk
description: Option<String>Description of what this chunk does
language: StringPrimary language
granularity: ChunkGranularityGranularity level
categories: Vec<ChunkCategory>Categories this chunk belongs to
Tags for search and discovery
concepts: Vec<String>Concepts this chunk implements
provides: Vec<String>Interfaces/APIs provided
requires: Vec<String>Interfaces/APIs required
platform: PlatformConstraintPlatform constraints
composition: ChunkCompositionComposition information
metrics: ChunkMetricsQuality metrics
sources: Vec<SourceLocation>Source location(s)
content_hash: StringContent hash (sha256)
size: usizeSize in bytes
license: StringLicense
created_at: Option<String>Creation timestamp
version: Option<String>Version if applicable
Implementations§
Source§impl AtomicChunk
impl AtomicChunk
Sourcepub fn new(
chunk_id: String,
name: String,
language: String,
content_hash: String,
size: usize,
) -> Self
pub fn new( chunk_id: String, name: String, language: String, content_hash: String, size: usize, ) -> Self
Create a new atomic chunk
Sourcepub fn with_alias(self, alias: impl Into<String>) -> Self
pub fn with_alias(self, alias: impl Into<String>) -> Self
Add a primary alias
Sourcepub fn with_aliases(self, aliases: Vec<String>) -> Self
pub fn with_aliases(self, aliases: Vec<String>) -> Self
Add multiple aliases
Sourcepub fn with_categories(self, categories: Vec<ChunkCategory>) -> Self
pub fn with_categories(self, categories: Vec<ChunkCategory>) -> Self
Set categories
Sourcepub fn with_granularity(self, granularity: ChunkGranularity) -> Self
pub fn with_granularity(self, granularity: ChunkGranularity) -> Self
Set granularity
Sourcepub fn with_concepts(self, concepts: Vec<String>) -> Self
pub fn with_concepts(self, concepts: Vec<String>) -> Self
Add concepts
Sourcepub fn composed_of(self, chunks: Vec<ChunkReference>) -> Self
pub fn composed_of(self, chunks: Vec<ChunkReference>) -> Self
Mark as composed of other chunks
Sourcepub fn primary_alias(&self) -> Option<&ChunkAlias>
pub fn primary_alias(&self) -> Option<&ChunkAlias>
Get the primary alias, if any
Sourcepub fn display_name(&self) -> String
pub fn display_name(&self) -> String
Get the display name (alias or chunk name)
Trait Implementations§
Source§impl Clone for AtomicChunk
impl Clone for AtomicChunk
Source§fn clone(&self) -> AtomicChunk
fn clone(&self) -> AtomicChunk
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AtomicChunk
impl Debug for AtomicChunk
Source§impl<'de> Deserialize<'de> for AtomicChunk
impl<'de> Deserialize<'de> for AtomicChunk
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AtomicChunk
impl RefUnwindSafe for AtomicChunk
impl Send for AtomicChunk
impl Sync for AtomicChunk
impl Unpin for AtomicChunk
impl UnwindSafe for AtomicChunk
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more