pub struct AccountingNetwork {
pub flows: Vec<AccountingFlow>,
pub accounts: HashSet<String>,
pub account_index: HashMap<String, usize>,
pub adjacency: HashMap<String, Vec<(String, usize)>>,
pub stats: NetworkGenerationStats,
}Expand description
Complete accounting network.
Fields§
§flows: Vec<AccountingFlow>All accounting flows.
accounts: HashSet<String>Account nodes (unique accounts).
account_index: HashMap<String, usize>Account index mapping for CSR representation.
adjacency: HashMap<String, Vec<(String, usize)>>Adjacency list (from_account -> [(to_account, flow_index)]).
stats: NetworkGenerationStatsStatistics.
Implementations§
Source§impl AccountingNetwork
impl AccountingNetwork
Sourcepub fn add_flow(&mut self, flow: AccountingFlow)
pub fn add_flow(&mut self, flow: AccountingFlow)
Add a flow to the network.
Sourcepub fn outgoing_flows(&self, account: &str) -> Vec<&AccountingFlow>
pub fn outgoing_flows(&self, account: &str) -> Vec<&AccountingFlow>
Get outgoing flows from an account.
Sourcepub fn incoming_flows(&self, account: &str) -> Vec<&AccountingFlow>
pub fn incoming_flows(&self, account: &str) -> Vec<&AccountingFlow>
Get incoming flows to an account.
Sourcepub fn query_temporal(
&self,
start_time: u64,
end_time: u64,
) -> Vec<&AccountingFlow>
pub fn query_temporal( &self, start_time: u64, end_time: u64, ) -> Vec<&AccountingFlow>
Query flows within a time window.
Sourcepub fn total_volume(&self) -> f64
pub fn total_volume(&self) -> f64
Calculate total flow volume.
Sourcepub fn weighted_confidence(&self) -> f64
pub fn weighted_confidence(&self) -> f64
Calculate weighted average confidence.
Trait Implementations§
Source§impl Clone for AccountingNetwork
impl Clone for AccountingNetwork
Source§fn clone(&self) -> AccountingNetwork
fn clone(&self) -> AccountingNetwork
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 AccountingNetwork
impl Debug for AccountingNetwork
Source§impl Default for AccountingNetwork
impl Default for AccountingNetwork
Source§fn default() -> AccountingNetwork
fn default() -> AccountingNetwork
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AccountingNetwork
impl RefUnwindSafe for AccountingNetwork
impl Send for AccountingNetwork
impl Sync for AccountingNetwork
impl Unpin for AccountingNetwork
impl UnwindSafe for AccountingNetwork
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.