summaryrefslogtreecommitdiffstats
path: root/src/cell.rs
diff options
context:
space:
mode:
authorpierresy <pierre-henri.symoneaux@alcatel-lucent.com>2015-11-07 15:13:26 +0100
committerpierresy <pierre-henri.symoneaux@alcatel-lucent.com>2015-11-07 15:13:26 +0100
commitc551d1f70c4994ae75a0750d3bebb55eb56bb7e2 (patch)
tree37c5054979bae321e70d2b678abb34eaa7496760 /src/cell.rs
parent0837f83b7d50dfcd1d17025c6f09cde810c1b5c7 (diff)
Issue #2 : Refactored code
Diffstat (limited to 'src/cell.rs')
-rw-r--r--src/cell.rs3
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()));