Skip to content

Commit

Permalink
feat(block_storage): implement Display for Volume to show just Volume…
Browse files Browse the repository at this point in the history
….inner

This allows to hide session details and just focus on the wrapped inner
protocol::Volume.

Signed-off-by: Sandro-Alessio Gierens <[email protected]>
  • Loading branch information
gierens committed Jan 31, 2024
1 parent 4e55bea commit 4edda7a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/block_storage/volumes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use async_trait::async_trait;
use futures::stream::{Stream, TryStreamExt};
use std::fmt::{self, Display, Formatter};

use super::super::common::{Refresh, ResourceIterator, ResourceQuery};
use super::super::session::Session;
Expand All @@ -39,6 +40,12 @@ pub struct Volume {
inner: protocol::Volume,
}

impl Display for Volume {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
write!(f, "{:#?}", self.inner)
}
}

impl Volume {
/// Create an Volume object.
pub(crate) async fn new<Id: AsRef<str>>(session: Session, id: Id) -> Result<Volume> {
Expand Down

0 comments on commit 4edda7a

Please sign in to comment.