pub struct Synapse {Show 13 fields
pub connection_id: String,
pub presynaptic_id: String,
pub postsynaptic_id: String,
pub strength: f64,
pub neurotransmitter_type: NeurotransmitterType,
pub last_activity: u64,
pub total_messages: u64,
pub success_rate: f64,
pub created_at: u64,
pub plasticity: f64,
pub latency_stats: LatencyStats,
pub state: SynapseState,
pub bidirectional: bool,
}
Expand description
Synaptic connection between organisms
Fieldsยง
ยงconnection_id: String
Unique connection identifier
presynaptic_id: String
Presynaptic organism (sender)
postsynaptic_id: String
Postsynaptic organism (receiver)
strength: f64
Connection strength (0.0-1.0)
neurotransmitter_type: NeurotransmitterType
Primary neurotransmitter type
last_activity: u64
Last activity timestamp
total_messages: u64
Total messages transmitted
success_rate: f64
Message success rate
created_at: u64
Connection creation time
plasticity: f64
Synaptic plasticity (ability to change)
latency_stats: LatencyStats
Connection latency statistics
state: SynapseState
Connection state
bidirectional: bool
Bidirectional capability
Implementationsยง
Sourceยงimpl Synapse
impl Synapse
Sourcepub fn establish(from_id: &str, to_id: &str) -> Result<Self, SynapseError>
pub fn establish(from_id: &str, to_id: &str) -> Result<Self, SynapseError>
Establish a new synaptic connection
Sourcepub async fn transmit(&self, message: NeuralMessage) -> Result<(), SynapseError>
pub async fn transmit(&self, message: NeuralMessage) -> Result<(), SynapseError>
Transmit a neural message through this synapse
Sourcepub fn strengthen(&mut self, factor: f64)
pub fn strengthen(&mut self, factor: f64)
Strengthen the synaptic connection
Sourcepub fn update_latency_stats(&mut self, latency: u64)
pub fn update_latency_stats(&mut self, latency: u64)
Update latency statistics
Sourcepub fn get_performance_metrics(&self) -> SynapsePerformance
pub fn get_performance_metrics(&self) -> SynapsePerformance
Get connection performance metrics
Trait Implementationsยง
Sourceยงimpl<'de> Deserialize<'de> for Synapse
impl<'de> Deserialize<'de> for Synapse
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 Synapse
impl RefUnwindSafe for Synapse
impl Send for Synapse
impl Sync for Synapse
impl Unpin for Synapse
impl UnwindSafe for Synapse
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