Gather

Struct Gather 

Source
pub struct Gather {
    pub attributes: GatherAttributes,
    pub nested: Vec<GatherNoun>,
}

Fields§

§attributes: GatherAttributes§nested: Vec<GatherNoun>

Implementations§

Source§

impl Gather

Source

pub fn new() -> Self

Examples found in repository?
examples/voice_call.rs (line 49)
48fn ivr_menu() {
49    let gather = Gather::new()
50        .input(vec!["dtmf".to_string(), "speech".to_string()])
51        .action("https://example.com/handle-input")
52        .method("POST")
53        .timeout(10)
54        .num_digits(1)
55        .add_say(Say::new(
56            "Press 1 for sales, 2 for support, or 3 for billing. You can also say the department name.",
57        ));
58
59    let response = VoiceResponse::new()
60        .say("Welcome to our automated phone system.")
61        .gather(gather)
62        .say("We didn't receive any input.")
63        .redirect("https://example.com/main-menu");
64
65    println!("{}", response.to_xml());
66}
Source

pub fn with_attributes(attributes: GatherAttributes) -> Self

Source

pub fn input(self, input: Vec<String>) -> Self

Examples found in repository?
examples/voice_call.rs (line 50)
48fn ivr_menu() {
49    let gather = Gather::new()
50        .input(vec!["dtmf".to_string(), "speech".to_string()])
51        .action("https://example.com/handle-input")
52        .method("POST")
53        .timeout(10)
54        .num_digits(1)
55        .add_say(Say::new(
56            "Press 1 for sales, 2 for support, or 3 for billing. You can also say the department name.",
57        ));
58
59    let response = VoiceResponse::new()
60        .say("Welcome to our automated phone system.")
61        .gather(gather)
62        .say("We didn't receive any input.")
63        .redirect("https://example.com/main-menu");
64
65    println!("{}", response.to_xml());
66}
Source

pub fn action(self, action: impl Into<String>) -> Self

Examples found in repository?
examples/voice_call.rs (line 51)
48fn ivr_menu() {
49    let gather = Gather::new()
50        .input(vec!["dtmf".to_string(), "speech".to_string()])
51        .action("https://example.com/handle-input")
52        .method("POST")
53        .timeout(10)
54        .num_digits(1)
55        .add_say(Say::new(
56            "Press 1 for sales, 2 for support, or 3 for billing. You can also say the department name.",
57        ));
58
59    let response = VoiceResponse::new()
60        .say("Welcome to our automated phone system.")
61        .gather(gather)
62        .say("We didn't receive any input.")
63        .redirect("https://example.com/main-menu");
64
65    println!("{}", response.to_xml());
66}
Source

pub fn method(self, method: impl Into<String>) -> Self

Examples found in repository?
examples/voice_call.rs (line 52)
48fn ivr_menu() {
49    let gather = Gather::new()
50        .input(vec!["dtmf".to_string(), "speech".to_string()])
51        .action("https://example.com/handle-input")
52        .method("POST")
53        .timeout(10)
54        .num_digits(1)
55        .add_say(Say::new(
56            "Press 1 for sales, 2 for support, or 3 for billing. You can also say the department name.",
57        ));
58
59    let response = VoiceResponse::new()
60        .say("Welcome to our automated phone system.")
61        .gather(gather)
62        .say("We didn't receive any input.")
63        .redirect("https://example.com/main-menu");
64
65    println!("{}", response.to_xml());
66}
Source

pub fn timeout(self, timeout: u32) -> Self

Examples found in repository?
examples/voice_call.rs (line 53)
48fn ivr_menu() {
49    let gather = Gather::new()
50        .input(vec!["dtmf".to_string(), "speech".to_string()])
51        .action("https://example.com/handle-input")
52        .method("POST")
53        .timeout(10)
54        .num_digits(1)
55        .add_say(Say::new(
56            "Press 1 for sales, 2 for support, or 3 for billing. You can also say the department name.",
57        ));
58
59    let response = VoiceResponse::new()
60        .say("Welcome to our automated phone system.")
61        .gather(gather)
62        .say("We didn't receive any input.")
63        .redirect("https://example.com/main-menu");
64
65    println!("{}", response.to_xml());
66}
Source

pub fn finish_on_key(self, key: impl Into<String>) -> Self

Source

pub fn num_digits(self, num_digits: u32) -> Self

Examples found in repository?
examples/voice_call.rs (line 54)
48fn ivr_menu() {
49    let gather = Gather::new()
50        .input(vec!["dtmf".to_string(), "speech".to_string()])
51        .action("https://example.com/handle-input")
52        .method("POST")
53        .timeout(10)
54        .num_digits(1)
55        .add_say(Say::new(
56            "Press 1 for sales, 2 for support, or 3 for billing. You can also say the department name.",
57        ));
58
59    let response = VoiceResponse::new()
60        .say("Welcome to our automated phone system.")
61        .gather(gather)
62        .say("We didn't receive any input.")
63        .redirect("https://example.com/main-menu");
64
65    println!("{}", response.to_xml());
66}
Source

pub fn language(self, language: impl Into<String>) -> Self

Source

pub fn hints(self, hints: impl Into<String>) -> Self

Source

pub fn action_on_empty_result(self, action_on_empty_result: bool) -> Self

Source

pub fn barge_in(self, barge_in: bool) -> Self

Source

pub fn debug(self, debug: bool) -> Self

Source

pub fn dtmf_detection(self, dtmf_detection: bool) -> Self

Source

pub fn enhanced(self, enhanced: bool) -> Self

Source

pub fn max_speech_time(self, max_speech_time: u32) -> Self

Source

pub fn partial_result_callback(self, callback: impl Into<String>) -> Self

Source

pub fn partial_result_callback_method(self, method: impl Into<String>) -> Self

Source

pub fn profanity_filter(self, profanity_filter: bool) -> Self

Source

pub fn speech_model(self, speech_model: impl Into<String>) -> Self

Source

pub fn speech_timeout(self, speech_timeout: impl Into<String>) -> Self

Source

pub fn add_say(self, say: Say) -> Self

Examples found in repository?
examples/voice_call.rs (lines 55-57)
48fn ivr_menu() {
49    let gather = Gather::new()
50        .input(vec!["dtmf".to_string(), "speech".to_string()])
51        .action("https://example.com/handle-input")
52        .method("POST")
53        .timeout(10)
54        .num_digits(1)
55        .add_say(Say::new(
56            "Press 1 for sales, 2 for support, or 3 for billing. You can also say the department name.",
57        ));
58
59    let response = VoiceResponse::new()
60        .say("Welcome to our automated phone system.")
61        .gather(gather)
62        .say("We didn't receive any input.")
63        .redirect("https://example.com/main-menu");
64
65    println!("{}", response.to_xml());
66}
Source

pub fn add_play(self, play: Play) -> Self

Source

pub fn add_pause(self, pause: Pause) -> Self

Trait Implementations§

Source§

impl Clone for Gather

Source§

fn clone(&self) -> Gather

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Gather

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Gather

§

impl RefUnwindSafe for Gather

§

impl Send for Gather

§

impl Sync for Gather

§

impl Unpin for Gather

§

impl UnwindSafe for Gather

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.