pub struct Median {
pub out: BaseOutput<BaseLink<Sender<Value>>>,
/* private fields */
}Expand description
Calculates the median of multiple numbers from the 16 inputs this block has. The operation would take into account the units of those input’s values, if the units are not convertible, the block would be in an error state.
Fields§
§out: BaseOutput<BaseLink<Sender<Value>>>Implementations§
Trait Implementations§
Source§impl BlockProps for Median
impl BlockProps for Median
Source§type Reader = <BaseInput<Receiver<Value>, Sender<Value>> as InputProps>::Reader
type Reader = <BaseInput<Receiver<Value>, Sender<Value>> as InputProps>::Reader
The block’s read type
This is the type used to read from the block’s inputs
Source§type Writer = <BaseInput<Receiver<Value>, Sender<Value>> as InputProps>::Writer
type Writer = <BaseInput<Receiver<Value>, Sender<Value>> as InputProps>::Writer
The block’s write type
This is the type used to write to the block’s outputs
Source§fn state(&self) -> BlockState
fn state(&self) -> BlockState
Blocks state
Source§fn set_state(&mut self, state: BlockState) -> BlockState
fn set_state(&mut self, state: BlockState) -> BlockState
Set the blocks state
Source§fn inputs(
&self,
) -> Vec<&dyn Input<Reader = Self::Reader, Writer = Self::Writer>>
fn inputs( &self, ) -> Vec<&dyn Input<Reader = Self::Reader, Writer = Self::Writer>>
List all the block inputs
Source§fn inputs_mut(
&mut self,
) -> Vec<&mut dyn Input<Reader = Self::Reader, Writer = Self::Writer>>
fn inputs_mut( &mut self, ) -> Vec<&mut dyn Input<Reader = Self::Reader, Writer = Self::Writer>>
List all the block inputs
Source§fn outputs_mut(&mut self) -> Vec<&mut dyn Output<Writer = Self::Writer>>
fn outputs_mut(&mut self) -> Vec<&mut dyn Output<Writer = Self::Writer>>
Mutable reference to the block’s output
Source§fn remove_link_by_id(&mut self, link_uuid: &Uuid)
fn remove_link_by_id(&mut self, link_uuid: &Uuid)
Remove a link by its id from the link collection
Source§fn remove_all_links(&mut self)
fn remove_all_links(&mut self)
Remove all links from this block
Source§fn get_input(
&self,
name: &str,
) -> Option<&dyn Input<Reader = Self::Reader, Writer = Self::Writer>>
fn get_input( &self, name: &str, ) -> Option<&dyn Input<Reader = Self::Reader, Writer = Self::Writer>>
Get block input by name
Source§fn get_input_mut(
&mut self,
name: &str,
) -> Option<&mut dyn Input<Reader = Self::Reader, Writer = Self::Writer>>
fn get_input_mut( &mut self, name: &str, ) -> Option<&mut dyn Input<Reader = Self::Reader, Writer = Self::Writer>>
Get block mutable input by name
Source§fn get_output(&self, name: &str) -> Option<&dyn Output<Writer = Self::Writer>>
fn get_output(&self, name: &str) -> Option<&dyn Output<Writer = Self::Writer>>
Get block output by name
Source§fn get_output_mut(
&mut self,
name: &str,
) -> Option<&mut dyn Output<Writer = Self::Writer>>
fn get_output_mut( &mut self, name: &str, ) -> Option<&mut dyn Output<Writer = Self::Writer>>
Get block mutable output by name
Source§fn remove_link(&mut self, link: &dyn Link)
fn remove_link(&mut self, link: &dyn Link)
Remove a link from the link collection
Source§impl BlockStaticDesc for Median
impl BlockStaticDesc for Median
Auto Trait Implementations§
impl Freeze for Median
impl RefUnwindSafe for Median
impl Send for Median
impl Sync for Median
impl Unpin for Median
impl UnwindSafe for Median
Blanket Implementations§
Source§impl<T> BlockConnect for T
impl<T> BlockConnect for T
Source§fn connect_output(
&mut self,
source_output_name: &str,
target_input: &mut dyn InputProps<Writer = <T as BlockProps>::Writer, Reader = <T as BlockProps>::Reader>,
) -> Result<Uuid, &'static str>
fn connect_output( &mut self, source_output_name: &str, target_input: &mut dyn InputProps<Writer = <T as BlockProps>::Writer, Reader = <T as BlockProps>::Reader>, ) -> Result<Uuid, &'static str>
Connect a block output to the given input Read more
Source§fn connect_input(
&mut self,
source_input_name: &str,
target_input: &mut dyn InputProps<Writer = <T as BlockProps>::Writer, Reader = <T as BlockProps>::Reader>,
) -> Result<Uuid, &'static str>
fn connect_input( &mut self, source_input_name: &str, target_input: &mut dyn InputProps<Writer = <T as BlockProps>::Writer, Reader = <T as BlockProps>::Reader>, ) -> Result<Uuid, &'static str>
Connect a block input to another’s block input Read more
Source§fn disconnect_output(
&mut self,
source_output_name: &str,
target_input: &mut dyn InputProps<Writer = <T as BlockProps>::Writer, Reader = <T as BlockProps>::Reader>,
) -> Result<(), &'static str>
fn disconnect_output( &mut self, source_output_name: &str, target_input: &mut dyn InputProps<Writer = <T as BlockProps>::Writer, Reader = <T as BlockProps>::Reader>, ) -> Result<(), &'static str>
Disconnect a block output from the given input Read more
Source§fn disconnect_input(
&mut self,
source_input_name: &str,
target_input: &mut dyn InputProps<Writer = <T as BlockProps>::Writer, Reader = <T as BlockProps>::Reader>,
) -> Result<(), &'static str>
fn disconnect_input( &mut self, source_input_name: &str, target_input: &mut dyn InputProps<Writer = <T as BlockProps>::Writer, Reader = <T as BlockProps>::Reader>, ) -> Result<(), &'static str>
Disconnect a block input from the given output Read more
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