fn new(
        maybe_event: Option<scheduler::Event>,
        stream_id: String,
        uri: hyper::Uri,
    ) -> Result<Self, failure::Error> {
        if let Some(event) = maybe_event {
            if event.has_subscribed() {
                let framework_id = event.get_subscribed().get_framework_id().clone();

                Ok(Self {
                    uri,
                    framework_id: framework_id.get_value().into(),
                    stream_id,
                })
            } else {
                Err(format_err!(
                    "Mesos {:?} event was not a SUBSCRIBED event",
                    event.get_field_type()
                ))
            }
        } else {
            Err(format_err!("Did not receive Mesos SUBSCRIBED event."))
        }
    }
/// Construct a new Mesos client from subcribe event, remaining Mesos events and Mesos streamd id.
Construct a new Mesos client from subcribe event, remaining Mesos events and Mesos streamd id.
Construct a new Mesos client from subcribe event remaining Mesos events and Mesos streamd id .
fn new(
        maybe_event: Option<scheduler::Event>,
        stream_id: String,
        uri: hyper::Uri,
    ) -> Result<Self, failure::Error> {
        if let Some(event) = maybe_event {
            if event.has_subscribed() {
                let framework_id = event.get_subscribed().get_framework_id().clone();
                Ok(Self {
                    uri,
                    framework_id: framework_id.get_value().into(),
                    stream_id,
                })
            } else {
                Err(format_err!(
                    "Mesos {:?} event was not a SUBSCRIBED event",
                    event.get_field_type()
                ))
            }
        } else {
            Err(format_err!("Did not receive Mesos SUBSCRIBED event."))
        }
    }
fn new ( maybe_event : Option < scheduler :: Event > , stream_id : String , uri : hyper :: Uri , ) -> Result < Self , failure :: Error > { if let Some ( event ) = maybe_event { if event . has_subscribed ( ) { let framework_id = event . get_subscribed ( ) . get_framework_id ( ) . clone ( ) ; Ok ( Self { uri , framework_id : framework_id . get_value ( ) . into ( ) , stream_id , } ) } else { Err ( format_err ! ( " " event get_field_type ( ) ) ) } } else { Err ( format_err ! ( " " ) ) } }
Construct a new Mesos client from subcribe event, remaining Mesos events and Mesos streamd id.
Construct a new Mesos client from subcribe event remaining Mesos events and Mesos streamd id .
maybe_event
Option<scheduler::Event>
stream_id
String
uri
hyper::Uri
maybe_event
Option<scheduler::Event>
stream_id
String
uri
hyper::Uri