pub struct GraphNode {
pub id: String,
pub name: String,
pub layer_type: String,
pub input_shape: Vec<usize>,
pub output_shape: Vec<usize>,
pub parameter_count: usize,
pub position: Option<(f32, f32)>,
pub metadata: HashMap<String, String>,
}Expand description
Represents a node in the network graph
Fields§
§id: StringUnique identifier for the node
name: StringDisplay name for the node
layer_type: StringType of the layer/module
input_shape: Vec<usize>Input shape
output_shape: Vec<usize>Output shape
parameter_count: usizeNumber of parameters
position: Option<(f32, f32)>Position in the graph (x, y)
metadata: HashMap<String, String>Additional metadata
Implementations§
Source§impl GraphNode
impl GraphNode
Sourcepub fn new(
id: String,
name: String,
layer_type: String,
input_shape: Vec<usize>,
output_shape: Vec<usize>,
parameter_count: usize,
) -> Self
pub fn new( id: String, name: String, layer_type: String, input_shape: Vec<usize>, output_shape: Vec<usize>, parameter_count: usize, ) -> Self
Create a new graph node
Sourcepub fn with_position(self, x: f32, y: f32) -> Self
pub fn with_position(self, x: f32, y: f32) -> Self
Set the position of the node
Sourcepub fn with_metadata(self, key: String, value: String) -> Self
pub fn with_metadata(self, key: String, value: String) -> Self
Add metadata to the node
Sourcepub fn short_description(&self) -> String
pub fn short_description(&self) -> String
Get a short description of the node
Sourcepub fn detailed_description(&self) -> String
pub fn detailed_description(&self) -> String
Get a detailed description of the node
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphNode
impl RefUnwindSafe for GraphNode
impl Send for GraphNode
impl Sync for GraphNode
impl Unpin for GraphNode
impl UnsafeUnpin for GraphNode
impl UnwindSafe for GraphNode
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 more