pub struct TopologyCache { /* private fields */ }Expand description
HTTP-backed topology cache for cortical areas.
Implementations§
Source§impl TopologyCache
impl TopologyCache
Sourcepub fn new(
host: impl Into<String>,
port: u16,
timeout_s: f64,
) -> Result<Self, SdkError>
pub fn new( host: impl Into<String>, port: u16, timeout_s: f64, ) -> Result<Self, SdkError>
Create a new topology cache for a FEAGI HTTP endpoint.
Sourcepub async fn get_topology(
&self,
id: &CorticalID,
) -> Result<CorticalTopology, SdkError>
pub async fn get_topology( &self, id: &CorticalID, ) -> Result<CorticalTopology, SdkError>
Fetch and cache topology for a single cortical ID.
Sourcepub async fn get_topologies(
&self,
ids: &[CorticalID],
) -> Result<Vec<CorticalTopology>, SdkError>
pub async fn get_topologies( &self, ids: &[CorticalID], ) -> Result<Vec<CorticalTopology>, SdkError>
Fetch and cache topologies for multiple cortical IDs.
Sourcepub async fn prefetch(&self, ids: &[CorticalID]) -> Result<(), SdkError>
pub async fn prefetch(&self, ids: &[CorticalID]) -> Result<(), SdkError>
Prefetch and cache topologies for the provided cortical IDs.
Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Clear all cached topology entries.
Sourcepub fn cache_size(&self) -> usize
pub fn cache_size(&self) -> usize
Return the number of cached cortical topologies.
Sourcepub fn parse_topology_payload(
id: &CorticalID,
payload: &Value,
) -> Result<CorticalTopology, SdkError>
pub fn parse_topology_payload( id: &CorticalID, payload: &Value, ) -> Result<CorticalTopology, SdkError>
Parse a topology payload returned by FEAGI HTTP APIs.
Trait Implementations§
Source§impl Clone for TopologyCache
impl Clone for TopologyCache
Source§fn clone(&self) -> TopologyCache
fn clone(&self) -> TopologyCache
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 moreAuto Trait Implementations§
impl Freeze for TopologyCache
impl !RefUnwindSafe for TopologyCache
impl Send for TopologyCache
impl Sync for TopologyCache
impl Unpin for TopologyCache
impl !UnwindSafe for TopologyCache
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more