Skip to content

Commit

Permalink
Seal Optionality trait
Browse files Browse the repository at this point in the history
  • Loading branch information
bash committed Jun 29, 2024
1 parent a0ae393 commit 5df92b5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/core/src/yarn_fn/optionality.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@
use yarnspinner_macros::all_tuples;

/// Marker trait for valid optionality hints.
pub trait Optionality {}
pub trait Optionality: private::Sealed {}

/// An optional parameter or a tuple where
/// the last element is optional.
pub struct Optional;

impl private::Sealed for Optional {}
impl Optionality for Optional {}

/// A parameter that is required.
pub struct Required;

impl private::Sealed for Required {}
impl Optionality for Required {}

mod private {
Expand Down

0 comments on commit 5df92b5

Please sign in to comment.