nominal-api-conjure 0.1449.0

Conjure HTTP API bindings for the Nominal platform
Documentation
/// A connection between two canvas objects. Drawn as a one-way arrow
/// from start to end; swap those endpoints to reverse it.
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct CanvasConnectionV1 {
    #[builder(custom(type = super::CanvasEndpoint, convert = Box::new))]
    #[serde(rename = "start")]
    start: Box<super::CanvasEndpoint>,
    #[builder(custom(type = super::CanvasEndpoint, convert = Box::new))]
    #[serde(rename = "end")]
    end: Box<super::CanvasEndpoint>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::CanvasConnectionStyle>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "style", skip_serializing_if = "Option::is_none", default)]
    style: Option<Box<super::CanvasConnectionStyle>>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::CanvasConnectionRouting>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "routing", skip_serializing_if = "Option::is_none", default)]
    routing: Option<Box<super::CanvasConnectionRouting>>,
}
impl CanvasConnectionV1 {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(start: super::CanvasEndpoint, end: super::CanvasEndpoint) -> Self {
        Self::builder().start(start).end(end).build()
    }
    /// The source endpoint. The displayed one-way arrow is drawn from
    /// start to end.
    #[inline]
    pub fn start(&self) -> &super::CanvasEndpoint {
        &*self.start
    }
    /// The target endpoint.
    #[inline]
    pub fn end(&self) -> &super::CanvasEndpoint {
        &*self.end
    }
    /// Visual styling for the connection. If absent, clients use defaults.
    #[inline]
    pub fn style(&self) -> Option<&super::CanvasConnectionStyle> {
        self.style.as_ref().map(|o| &**o)
    }
    /// Manual routing. When absent, clients calculate an automatic route.
    #[inline]
    pub fn routing(&self) -> Option<&super::CanvasConnectionRouting> {
        self.routing.as_ref().map(|o| &**o)
    }
}