Skip to main content

GraphEvent

Enum GraphEvent 

Source
pub enum GraphEvent<N, P, C>
where N: NodeId, P: PortId, C: ConnectionId,
{ NodesMoved { nodes: Vec<(N, Position)>, }, NodeResized { id: N, size: Size, }, ConnectionRequested { source: P, target: P, }, ConnectionRemoved { id: C, }, SelectionChanged { nodes: HashSet<N>, connections: HashSet<C>, }, NodesDeleted { ids: Vec<N>, }, NodesCopied { ids: Vec<N>, }, NodesPasted { offset: Position, }, Undo, Redo, GroupCreated { node_ids: Vec<N>, }, CreateNode { item_id: String, position: Position, connect_from: Option<P>, connect_to: Option<String>, connect_direction: Option<PortDirection>, }, }

Variants§

§

NodesMoved

Final positions for every node moved by one drag gesture.

Fields

§nodes: Vec<(N, Position)>
§

NodeResized

Fields

§id: N
§size: Size
§

ConnectionRequested

Fields

§source: P
§target: P
§

ConnectionRemoved

Fields

§id: C
§

SelectionChanged

Fields

§nodes: HashSet<N>
§connections: HashSet<C>
§

NodesDeleted

Fields

§ids: Vec<N>
§

NodesCopied

Fields

§ids: Vec<N>
§

NodesPasted

Fields

§offset: Position
§

Undo

§

Redo

§

GroupCreated

Fields

§node_ids: Vec<N>
§

CreateNode

User selected a node type from the creation menu. Consumer should create the node, and if connect_from/connect_to are set, also create a connection between them.

Fields

§item_id: String

The menu item id (node type).

§position: Position

Canvas position where the node should be created.

§connect_from: Option<P>

The port that initiated the draft connection (if menu was opened during a drag).

§connect_to: Option<String>

The port id on the new node to connect to (e.g. “a”, “result”). Consumer prefixes this with the new node’s id.

§connect_direction: Option<PortDirection>

Direction of the draft origin, so consumer knows output→input order.

Trait Implementations§

Source§

impl<N, P, C> Clone for GraphEvent<N, P, C>
where N: NodeId + Clone, P: PortId + Clone, C: ConnectionId + Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<N, P, C> Debug for GraphEvent<N, P, C>
where N: NodeId + Debug, P: PortId + Debug, C: ConnectionId + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<N, P, C> Freeze for GraphEvent<N, P, C>
where Vec<(N, Position)>: Freeze, N: Freeze, P: Freeze, C: Freeze, HashSet<N>: Freeze, HashSet<C>: Freeze, Vec<N>: Freeze, Option<P>: Freeze,

§

impl<N, P, C> RefUnwindSafe for GraphEvent<N, P, C>

§

impl<N, P, C> Send for GraphEvent<N, P, C>
where Vec<(N, Position)>: Send, HashSet<N>: Send, HashSet<C>: Send, Vec<N>: Send, Option<P>: Send,

§

impl<N, P, C> Sync for GraphEvent<N, P, C>
where Vec<(N, Position)>: Sync, HashSet<N>: Sync, HashSet<C>: Sync, Vec<N>: Sync, Option<P>: Sync,

§

impl<N, P, C> Unpin for GraphEvent<N, P, C>
where Vec<(N, Position)>: Unpin, N: Unpin, P: Unpin, C: Unpin, HashSet<N>: Unpin, HashSet<C>: Unpin, Vec<N>: Unpin, Option<P>: Unpin,

§

impl<N, P, C> UnsafeUnpin for GraphEvent<N, P, C>

§

impl<N, P, C> UnwindSafe for GraphEvent<N, P, C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<E, T, Request, Encoding> FromReq<Patch<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request, Encoding> FromReq<Post<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request, Encoding> FromReq<Put<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, Encoding, Response, T> FromRes<Patch<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<E, Encoding, Response, T> FromRes<Post<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<E, Encoding, Response, T> FromRes<Put<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<El, T, Marker> IntoElementMaybeSignal<T, Marker> for El
where El: IntoElementMaybeSignalType<T, Marker>,

Source§

impl<T, Js> IntoElementMaybeSignalType<T, Element> for Js
where T: From<Js> + Clone,

Source§

impl<El, T, Marker> IntoElementsMaybeSignal<T, Marker> for El
where El: IntoElementsMaybeSignalType<T, Marker>,

Source§

impl<T, Js> IntoElementsMaybeSignalType<T, Element> for Js
where T: From<Js> + Clone,

Source§

impl<E, T, Encoding, Request> IntoReq<Patch<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Encoding, Request> IntoReq<Post<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Encoding, Request> IntoReq<Put<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, Response, Encoding, T> IntoRes<Patch<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<E, Response, Encoding, T> IntoRes<Post<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<E, Response, Encoding, T> IntoRes<Put<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<T> SerializableKey for T

Source§

fn ser_key(&self) -> String

Serializes the key to a unique string. Read more
Source§

impl<T> StorageAccess<T> for T

Source§

fn as_borrowed(&self) -> &T

Borrows the value.
Source§

fn into_taken(self) -> T

Takes the value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more