From 05210b9510b797f7738d5b2d51e8a6877f2d5283 Mon Sep 17 00:00:00 2001 From: Matan Kushner Date: Fri, 4 Oct 2019 22:30:46 +0900 Subject: refactor: Go from Rust workspaces to a package with nested packages (#480) --- src/segment.rs | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 src/segment.rs (limited to 'src/segment.rs') diff --git a/src/segment.rs b/src/segment.rs new file mode 100644 index 000000000..8c0140ac1 --- /dev/null +++ b/src/segment.rs @@ -0,0 +1,66 @@ +use ansi_term::{ANSIString, Style}; +use std::fmt; + +/// A segment is a single configurable element in a module. This will usually +/// contain a data point to provide context for the prompt's user +/// (e.g. The version that software is running). +pub struct Segment { + /// The segment's name, to be used in configuration and logging. + _name: String, + + /// The segment's style. If None, will inherit the style of the module containing it. + style: Option