pub struct Post {
    state: Option<Box<State>>,
    content: String
}

impl Post {
    pub fn new() -> Post {
        Post {
            state: Some(Box::new(Draft {})),
            content: String::new()
        }
    }

    pub fn add_text(&mut self, text: &str) {
        self.content.push_str(text);
    }
}

trait State {}

struct Draft {}

impl State for Draft {}

pub struct Post {
    state: Option<Box<State>>,
    content: String
}

impl Post {
    pub fn new() -> Post {
        Post {
            state: Some(Box::new(Draft {})),
            content: String::new()
        }
    }
}

trait State {}

struct Draft {}

impl State for Draft {}

--- 
+++ 
@@ -10,6 +10,10 @@
             content: String::new()
         }
     }
+
+    pub fn add_text(&mut self, text: &str) {
+        self.content.push_str(text);
+    }
 }
 
 trait State {}
Implement method for adding text to Post
