pub fn push_input(
        &mut self,
        index: QueueIndex,
        msg: RequestOrResponse,
        max_canister_memory_size: NumBytes,
        subnet_available_memory: &mut i64,
    ) -> Result<(), (StateError, RequestOrResponse)> {
        let own_subnet_type = self.metadata.own_subnet_type;
        let input_queue_type = match self.find_subnet_id(*msg.sender().get_ref()) {
            Ok(sender_subnet_id) => {
                if self.metadata.own_subnet_id == sender_subnet_id {
                    InputQueueType::LocalSubnet
                } else {
                    InputQueueType::RemoteSubnet
                }
            }
            Err(_) => InputQueueType::LocalSubnet, // unknown sender is local subnet
        };
        match self.canister_state_mut(&msg.receiver()) {
            Some(receiver_canister) => receiver_canister.push_input(
                index,
                msg,
                max_canister_memory_size,
                subnet_available_memory,
                own_subnet_type,
                input_queue_type,
            ),
            None => {
                let subnet_id = self.metadata.own_subnet_id.get_ref();
                if msg.receiver().get_ref() == subnet_id {
                    push_input(
                        &mut self.subnet_queues,
                        index,
                        msg,
                        // No canister limit, so pass the subnet limit twice.
                        *subnet_available_memory,
                        subnet_available_memory,
                        own_subnet_type,
                        input_queue_type,
                    )
                } else {
                    Err((StateError::CanisterNotFound(msg.receiver()), msg))
                }
            }
        }
    }
/// Pushes a `RequestOrResponse` into the induction pool (canister or subnet
/// input queue).
///
/// The messages from the same subnet get pushed into the local subnet
/// queue, while the messages form the other subnets get pushed to the inter
/// subnet queues.
///
/// On failure (queue full, canister not found, out of memory), returns the
/// corresponding error and the original message.
///
/// Updates `subnet_available_memory` to reflect any change in memory usage.
Pushes a `RequestOrResponse` into the induction pool (canister or subnet
input queue).

The messages from the same subnet get pushed into the local subnet
queue, while the messages form the other subnets get pushed to the inter
subnet queues.

On failure (queue full, canister not found, out of memory), returns the
corresponding error and the original message.

Updates `subnet_available_memory` to reflect any change in memory usage.
Pushes a ` RequestOrResponse ` into the induction pool ( canister or subnet input queue ) . The messages from the same subnet get pushed into the local subnet queue while the messages form the other subnets get pushed to the inter subnet queues . On failure ( queue full canister not found out of memory ) returns the corresponding error and the original message . Updates ` subnet_available_memory ` to reflect any change in memory usage .
pub fn push_input(
        &mut self,
        index: QueueIndex,
        msg: RequestOrResponse,
        max_canister_memory_size: NumBytes,
        subnet_available_memory: &mut i64,
    ) -> Result<(), (StateError, RequestOrResponse)> {
        let own_subnet_type = self.metadata.own_subnet_type;
        let input_queue_type = match self.find_subnet_id(*msg.sender().get_ref()) {
            Ok(sender_subnet_id) => {
                if self.metadata.own_subnet_id == sender_subnet_id {
                    InputQueueType::LocalSubnet
                } else {
                    InputQueueType::RemoteSubnet
                }
            }
            Err(_) => InputQueueType::LocalSubnet, // unknown sender is local subnet
        };
        match self.canister_state_mut(&msg.receiver()) {
            Some(receiver_canister) => receiver_canister.push_input(
                index,
                msg,
                max_canister_memory_size,
                subnet_available_memory,
                own_subnet_type,
                input_queue_type,
            ),
            None => {
                let subnet_id = self.metadata.own_subnet_id.get_ref();
                if msg.receiver().get_ref() == subnet_id {
                    push_input(
                        &mut self.subnet_queues,
                        index,
                        msg,
                        // No canister limit, so pass the subnet limit twice.
                        *subnet_available_memory,
                        subnet_available_memory,
                        own_subnet_type,
                        input_queue_type,
                    )
                } else {
                    Err((StateError::CanisterNotFound(msg.receiver()), msg))
                }
            }
        }
    }
pub fn push_input ( & mut self , index : QueueIndex , msg : RequestOrResponse , max_canister_memory_size : NumBytes , subnet_available_memory : & mut i64 , ) -> Result < ( ) , ( StateError , RequestOrResponse ) > { let own_subnet_type = self . metadata . own_subnet_type ; let input_queue_type = match self . find_subnet_id ( * msg . sender ( ) . get_ref ( ) ) { Ok ( sender_subnet_id ) => { if self . metadata . own_subnet_id == sender_subnet_id { InputQueueType :: LocalSubnet } else { InputQueueType :: RemoteSubnet } } Err ( _ ) => InputQueueType :: LocalSubnet , // unknown sender is local subnet } ; match self . canister_state_mut ( & msg . receiver ( ) ) { Some ( receiver_canister ) => receiver_canister . push_input ( index , msg , max_canister_memory_size , subnet_available_memory , own_subnet_type , input_queue_type , ) , None => { let subnet_id = self . metadata . own_subnet_id . get_ref ( ) ; if msg . receiver ( ) . get_ref ( ) == subnet_id { push_input ( & mut self . subnet_queues , index , msg , // No canister limit, so pass the subnet limit twice. * subnet_available_memory , subnet_available_memory , own_subnet_type , input_queue_type , ) } else { Err ( ( StateError :: CanisterNotFound ( msg . receiver ( ) ) , msg ) ) } } } }
Pushes a `RequestOrResponse` into the induction pool (canister or subnet
input queue).
Pushes a ` RequestOrResponse ` into the induction pool ( canister or subnet input queue ) .
&mut self
index
QueueIndex
msg
RequestOrResponse
max_canister_memory_size
NumBytes
subnet_available_memory
&mut i64
&mut self
index
QueueIndex
msg
RequestOrResponse
max_canister_memory_size
NumBytes
subnet_available_memory
&mut i64