diff options
author | pierresy <pierre-henri.symoneaux@alcatel-lucent.com> | 2015-11-07 15:13:26 +0100 |
---|---|---|
committer | pierresy <pierre-henri.symoneaux@alcatel-lucent.com> | 2015-11-07 15:13:26 +0100 |
commit | c551d1f70c4994ae75a0750d3bebb55eb56bb7e2 (patch) | |
tree | 37c5054979bae321e70d2b678abb34eaa7496760 /src/cell.rs | |
parent | 0837f83b7d50dfcd1d17025c6f09cde810c1b5c7 (diff) |
Issue #2 : Refactored code
Diffstat (limited to 'src/cell.rs')
-rw-r--r-- | src/cell.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cell.rs b/src/cell.rs index e47e6fc..04f8722 100644 --- a/src/cell.rs +++ b/src/cell.rs @@ -49,10 +49,12 @@ impl Cell { self.align = align;
}
+ /// Add a style attribute to the cell
pub fn style(&mut self, attr: Attr) {
self.style.push(attr);
}
+ /// Add a style attribute to the cell. Can be chained
pub fn with_style(mut self, attr: Attr) -> Cell {
self.style(attr);
return self;
@@ -89,6 +91,7 @@ impl Cell { }
}
+ /// Apply style then call `print` to print the cell into a terminal
pub fn print_term<T: Terminal+?Sized>(&self, out: &mut T, idx: usize, col_width: usize) -> Result<(), Error> {
for a in &self.style {
try!(out.attr(a.clone()));
|