pub struct Flow {
pub id: Uuid,
pub workspace_id: Uuid,
pub kind: String,
pub name: String,
pub description: Option<String>,
pub current_version_id: Option<Uuid>,
pub is_published_to_marketplace: bool,
pub created_by: Option<Uuid>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Fields§
§id: Uuid§workspace_id: Uuid§kind: String§name: String§description: Option<String>§current_version_id: Option<Uuid>§is_published_to_marketplace: bool§created_by: Option<Uuid>§created_at: DateTime<Utc>§updated_at: DateTime<Utc>Implementations§
Source§impl Flow
impl Flow
Sourcepub const VALID_KINDS: &'static [&'static str]
pub const VALID_KINDS: &'static [&'static str]
Recognized kind values. Open enum — additions are non-breaking.
pub fn is_valid_kind(kind: &str) -> bool
Sourcepub async fn list_by_workspace(
pool: &Pool<Postgres>,
workspace_id: Uuid,
kind: Option<&str>,
) -> Result<Vec<Flow>, Error>
pub async fn list_by_workspace( pool: &Pool<Postgres>, workspace_id: Uuid, kind: Option<&str>, ) -> Result<Vec<Flow>, Error>
List flows in a workspace, optionally filtered by kind. Newest updates first.
pub async fn find_by_id( pool: &Pool<Postgres>, id: Uuid, ) -> Result<Option<Flow>, Error>
Sourcepub async fn create_with_initial_version(
pool: &Pool<Postgres>,
input: CreateFlow<'_>,
) -> Result<(Flow, FlowVersion), Error>
pub async fn create_with_initial_version( pool: &Pool<Postgres>, input: CreateFlow<'_>, ) -> Result<(Flow, FlowVersion), Error>
Create a flow + its first flow_version in a single transaction.
flows.current_version_id is set to the new version’s id before
commit so callers always see a valid pointer.
Sourcepub async fn save_new_version(
pool: &Pool<Postgres>,
flow_id: Uuid,
config: &Value,
created_by: Option<Uuid>,
) -> Result<FlowVersion, Error>
pub async fn save_new_version( pool: &Pool<Postgres>, flow_id: Uuid, config: &Value, created_by: Option<Uuid>, ) -> Result<FlowVersion, Error>
Save a new version. Bumps version_number to max+1, inserts the
row, and updates flows.current_version_id. Returns the new
version. The old current_version_id value stays in
flow_versions — that’s the rollback target.
pub async fn rename( pool: &Pool<Postgres>, id: Uuid, name: Option<&str>, description: Option<Option<&str>>, ) -> Result<Option<Flow>, Error>
pub async fn delete(pool: &Pool<Postgres>, id: Uuid) -> Result<bool, Error>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Flow
impl<'de> Deserialize<'de> for Flow
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Flow, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Flow, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a, R> FromRow<'a, R> for Flowwhere
R: Row,
&'a str: ColumnIndex<R>,
Uuid: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
String: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<String>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<Uuid>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
bool: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
DateTime<Utc>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
impl<'a, R> FromRow<'a, R> for Flowwhere
R: Row,
&'a str: ColumnIndex<R>,
Uuid: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
String: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<String>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<Uuid>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
bool: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
DateTime<Utc>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Source§impl Serialize for Flow
impl Serialize for Flow
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Flow
impl RefUnwindSafe for Flow
impl Send for Flow
impl Sync for Flow
impl Unpin for Flow
impl UnsafeUnpin for Flow
impl UnwindSafe for Flow
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.