pub struct CodeBlock {Show 13 fields
pub id: String,
pub name: String,
pub purpose: String,
pub block_type: BlockType,
pub content: String,
pub importance: f64,
pub state: BlockState,
pub connections: Vec<Connection>,
pub tags: HashSet<String>,
pub metadata: HashMap<String, String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub access_count: u64,
}Expand description
CodeBlock - Onismero kod egyseg
Minden block tudja:
- Ki o (identity)
- Mit tartalmaz (content)
- Kihez kapcsolodik (connections)
- Miert letezik (purpose)
Fields§
§id: StringEgyedi azonosito
name: StringNev
purpose: StringCel/Miert letezik
block_type: BlockTypeBlock tipus
content: StringTartalom (barmi lehet - kod, adat, szoveg)
importance: f64Fontossag (0.0 - 1.0)
state: BlockStateAllapot
connections: Vec<Connection>Kapcsolatok mas block-okhoz
Cimkek
metadata: HashMap<String, String>Metaadatok
created_at: DateTime<Utc>Letrehozas ideje
updated_at: DateTime<Utc>Utolso modositas
access_count: u64Hozzaferes szamlalo
Implementations§
Source§impl CodeBlock
impl CodeBlock
Sourcepub fn new(
name: impl Into<String>,
purpose: impl Into<String>,
block_type: BlockType,
content: impl Into<String>,
) -> Self
pub fn new( name: impl Into<String>, purpose: impl Into<String>, block_type: BlockType, content: impl Into<String>, ) -> Self
Uj CodeBlock
Sourcepub fn with_importance(self, importance: f64) -> Self
pub fn with_importance(self, importance: f64) -> Self
Fontossag beallitasa
Sourcepub fn with_meta(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn with_meta(self, key: impl Into<String>, value: impl Into<String>) -> Self
Metadata hozzaadasa
Sourcepub fn connect(
&mut self,
target_id: impl Into<String>,
conn_type: ConnectionType,
)
pub fn connect( &mut self, target_id: impl Into<String>, conn_type: ConnectionType, )
Kapcsolat hozzaadasa
Sourcepub fn connect_with_strength(
&mut self,
target_id: impl Into<String>,
conn_type: ConnectionType,
strength: f64,
)
pub fn connect_with_strength( &mut self, target_id: impl Into<String>, conn_type: ConnectionType, strength: f64, )
Kapcsolat hozzaadasa erosseggel
Sourcepub fn get_connections(&self, conn_type: ConnectionType) -> Vec<&Connection>
pub fn get_connections(&self, conn_type: ConnectionType) -> Vec<&Connection>
Kapcsolatok lekerese tipus alapjan
Sourcepub fn connected_ids(&self) -> Vec<&str>
pub fn connected_ids(&self) -> Vec<&str>
Osszes kapcsolt ID
Sourcepub fn content_hash(&self) -> String
pub fn content_hash(&self) -> String
Block hash (tartalom alapjan)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CodeBlock
impl<'de> Deserialize<'de> for CodeBlock
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 CodeBlock
impl RefUnwindSafe for CodeBlock
impl Send for CodeBlock
impl Sync for CodeBlock
impl Unpin for CodeBlock
impl UnwindSafe for CodeBlock
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request