pub struct TextInputBuilder { /* private fields */ }
Expand description
This TextInputBuilder
struct creates the TextInput
.
Implementations§
Source§impl TextInputBuilder
impl TextInputBuilder
Sourcepub fn new() -> TextInputBuilder
pub fn new() -> TextInputBuilder
Construct a new TextInputBuilder
and return default values.
§Examples
use feed::TextInputBuilder;
let text_input_builder = TextInputBuilder::new();
Sourcepub fn title(&mut self, title: &str) -> &mut TextInputBuilder
pub fn title(&mut self, title: &str) -> &mut TextInputBuilder
Set the title that exists under TextInput
.
§Examples
use feed::TextInputBuilder;
let mut text_input_builder = TextInputBuilder::new();
text_input_builder.title("Title");
Sourcepub fn description(&mut self, description: &str) -> &mut TextInputBuilder
pub fn description(&mut self, description: &str) -> &mut TextInputBuilder
Set the description that exists under TextInput
.
§Examples
use feed::TextInputBuilder;
let mut text_input_builder = TextInputBuilder::new();
text_input_builder.description("This is a test description.");
Sourcepub fn name(&mut self, name: &str) -> &mut TextInputBuilder
pub fn name(&mut self, name: &str) -> &mut TextInputBuilder
Set the name that exists under TextInput
.
§Examples
use feed::TextInputBuilder;
let mut text_input_builder = TextInputBuilder::new();
text_input_builder.name("Comments");
Sourcepub fn link(&mut self, link: &str) -> &mut TextInputBuilder
pub fn link(&mut self, link: &str) -> &mut TextInputBuilder
Set the link that exists under TextInput
.
§Examples
use feed::TextInputBuilder;
let mut text_input_builder = TextInputBuilder::new();
text_input_builder.link("http://www.example.com/feedback");
Sourcepub fn validate(&mut self) -> Result<&mut TextInputBuilder, String>
pub fn validate(&mut self) -> Result<&mut TextInputBuilder, String>
Validate the contents of TextInput
.
§Examples
use feed::TextInputBuilder;
let text_input = TextInputBuilder::new()
.title("Title")
.description("This is a test description.")
.name("Comments")
.link("http://www.example.com/feedback")
.validate().unwrap()
.finalize().unwrap();
Sourcepub fn finalize(&self) -> Result<TextInput, String>
pub fn finalize(&self) -> Result<TextInput, String>
Construct the TextInput
from the TextInputBuilder
.
§Examples
use feed::TextInputBuilder;
let text_input = TextInputBuilder::new()
.title("Title")
.description("This is a test description.")
.name("Comments")
.link("http://www.example.com/feedback")
.finalize()
.unwrap();
Trait Implementations§
Source§impl Clone for TextInputBuilder
impl Clone for TextInputBuilder
Source§fn clone(&self) -> TextInputBuilder
fn clone(&self) -> TextInputBuilder
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for TextInputBuilder
impl Default for TextInputBuilder
Source§fn default() -> TextInputBuilder
fn default() -> TextInputBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TextInputBuilder
impl RefUnwindSafe for TextInputBuilder
impl Send for TextInputBuilder
impl Sync for TextInputBuilder
impl Unpin for TextInputBuilder
impl UnwindSafe for TextInputBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more