fn from()

in sdk/core/azure_core_amqp/src/messaging.rs [611:640]


    fn from(list: AmqpList) -> Self {
        let mut header = AmqpMessageHeader::default();
        let field_count = list.len();
        if field_count >= 1 {
            if let Some(AmqpValue::Boolean(durable)) = list.0.first() {
                header.durable = *durable;
            }
        }
        if field_count >= 2 {
            if let Some(AmqpValue::UByte(priority)) = list.0.get(1) {
                header.priority = *priority;
            }
        }
        if field_count >= 3 {
            if let Some(AmqpValue::UInt(time_to_live)) = list.0.get(2) {
                header.time_to_live = Some(std::time::Duration::from_millis(*time_to_live as u64));
            }
        }
        if field_count >= 4 {
            if let Some(AmqpValue::Boolean(first_acquirer)) = list.0.get(3) {
                header.first_acquirer = *first_acquirer;
            }
        }
        if field_count >= 5 {
            if let Some(AmqpValue::UInt(delivery_count)) = list.0.get(4) {
                header.delivery_count = *delivery_count;
            }
        }
        header
    }