nominal-api-conjure 0.1426.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,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash
)]
#[serde(crate = "conjure_object::serde")]
#[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>>,
}
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)
    }
}