pub struct Gather {
pub attributes: GatherAttributes,
pub nested: Vec<GatherNoun>,
}Fields§
§attributes: GatherAttributes§nested: Vec<GatherNoun>Implementations§
Source§impl Gather
impl Gather
Sourcepub fn new() -> Self
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}pub fn with_attributes(attributes: GatherAttributes) -> Self
Sourcepub fn input(self, input: Vec<String>) -> Self
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}Sourcepub fn action(self, action: impl Into<String>) -> Self
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}Sourcepub fn method(self, method: impl Into<String>) -> Self
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}Sourcepub fn timeout(self, timeout: u32) -> Self
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}pub fn finish_on_key(self, key: impl Into<String>) -> Self
Sourcepub fn num_digits(self, num_digits: u32) -> Self
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}pub fn language(self, language: impl Into<String>) -> Self
pub fn hints(self, hints: impl Into<String>) -> Self
pub fn action_on_empty_result(self, action_on_empty_result: bool) -> Self
pub fn barge_in(self, barge_in: bool) -> Self
pub fn debug(self, debug: bool) -> Self
pub fn dtmf_detection(self, dtmf_detection: bool) -> Self
pub fn enhanced(self, enhanced: bool) -> Self
pub fn max_speech_time(self, max_speech_time: u32) -> Self
pub fn partial_result_callback(self, callback: impl Into<String>) -> Self
pub fn partial_result_callback_method(self, method: impl Into<String>) -> Self
pub fn profanity_filter(self, profanity_filter: bool) -> Self
pub fn speech_model(self, speech_model: impl Into<String>) -> Self
pub fn speech_timeout(self, speech_timeout: impl Into<String>) -> Self
Sourcepub fn add_say(self, say: Say) -> Self
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}pub fn add_play(self, play: Play) -> Self
pub fn add_pause(self, pause: Pause) -> Self
Trait Implementations§
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> 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