pub struct CurrentAdapter { /* private fields */ }Expand description
Handles tile export/import across the fleet current. Hand-rolled line protocol (no serde, cargo 1.75 compatible).
Implementations§
Source§impl CurrentAdapter
impl CurrentAdapter
pub fn new() -> Self
pub fn with_max_transport(self, max: usize) -> Self
Sourcepub fn store(&mut self, tile: TransportTile) -> bool
pub fn store(&mut self, tile: TransportTile) -> bool
Store a tile
Sourcepub fn get(&self, id: &str) -> Option<&TransportTile>
pub fn get(&self, id: &str) -> Option<&TransportTile>
Get a tile by ID
Sourcepub fn remove(&mut self, id: &str) -> Option<TransportTile>
pub fn remove(&mut self, id: &str) -> Option<TransportTile>
Remove a tile
Sourcepub fn tile_count(&self) -> usize
pub fn tile_count(&self) -> usize
Tile count
Sourcepub fn export_tiles(&self, ids: &[&str]) -> ExportResult
pub fn export_tiles(&self, ids: &[&str]) -> ExportResult
Export tiles matching IDs, returns serialized payload
Sourcepub fn import_tiles(&mut self, data: &[u8]) -> ImportResult
pub fn import_tiles(&mut self, data: &[u8]) -> ImportResult
Import tiles from serialized payload
Sourcepub fn export_all(&self) -> ExportResult
pub fn export_all(&self) -> ExportResult
Export all tiles
Sourcepub fn stats(&self) -> CurrentStats
pub fn stats(&self) -> CurrentStats
Stats
Trait Implementations§
Source§impl Clone for CurrentAdapter
impl Clone for CurrentAdapter
Source§fn clone(&self) -> CurrentAdapter
fn clone(&self) -> CurrentAdapter
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 CurrentLayer for CurrentAdapter
impl CurrentLayer for CurrentAdapter
Source§impl Debug for CurrentAdapter
impl Debug for CurrentAdapter
Auto Trait Implementations§
impl Freeze for CurrentAdapter
impl RefUnwindSafe for CurrentAdapter
impl Send for CurrentAdapter
impl Sync for CurrentAdapter
impl Unpin for CurrentAdapter
impl UnsafeUnpin for CurrentAdapter
impl UnwindSafe for CurrentAdapter
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