pub struct Portfolio {
pub addresses: Vec<WatchedAddress>,
}Expand description
Portfolio data storage.
Fields§
§addresses: Vec<WatchedAddress>All watched addresses.
Implementations§
Source§impl Portfolio
impl Portfolio
Sourcepub fn save(&self, data_dir: &PathBuf) -> Result<()>
pub fn save(&self, data_dir: &PathBuf) -> Result<()>
Saves the portfolio to the data directory.
Sourcepub fn add_address(&mut self, watched: WatchedAddress) -> Result<()>
pub fn add_address(&mut self, watched: WatchedAddress) -> Result<()>
Adds an address to the portfolio.
Sourcepub fn remove_address(&mut self, address: &str) -> Result<bool>
pub fn remove_address(&mut self, address: &str) -> Result<bool>
Removes an address from the portfolio.
Sourcepub fn find_address(&self, address: &str) -> Option<&WatchedAddress>
pub fn find_address(&self, address: &str) -> Option<&WatchedAddress>
Finds an address in the portfolio.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Portfolio
impl<'de> Deserialize<'de> for Portfolio
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 Portfolio
impl RefUnwindSafe for Portfolio
impl Send for Portfolio
impl Sync for Portfolio
impl Unpin for Portfolio
impl UnwindSafe for Portfolio
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