twilio-rs icon indicating copy to clipboard operation
twilio-rs copied to clipboard

Make `message` module public and format code

Open omikuji opened this issue 5 months ago • 1 comments

Thank you for creating such a wonderful crate!

I would like to discuss the MessageStatus. Currently, message.rs is not public, making it inaccessible for external use, which prevents handling through the enum.

This is how I would like to use it:

let twilio_message = client
    .send_message(OutboundMessage::new(&param.twilio.from_us, &param.tel, &param.content))
    .await?;

    match twilio_message.status {
        Some(twilio::message::MessageStatus::Queued) => {
            println!("Message is queued!");
            Ok(())
        },
        Some(status) => {
            println!("Message status: {:?}", status);
            Ok(())
        },
        None => {
            Err(Error::App("Failed to get message status.".to_string()))
        }
    }

If possible, I would appreciate it if you could make message.rs public.

omikuji avatar Sep 17 '24 05:09 omikuji