pub fn register_syscall_by_hash<E: UserDefinedError, O: SyscallObject<E>>(
        &mut self,
        hash: u32,
        function: SyscallFunction<E, &mut O>,
    ) -> Result<(), EbpfError<E>> {
        let function = function as *const u8 as u64;
        let context_object_slot = self.entries.len();
        if self
            .entries
            .insert(
                hash,
                Syscall {
                    function,
                    context_object_slot,
                },
            )
            .is_some()
            || self
                .context_object_slots
                .insert(function, context_object_slot)
                .is_some()
        {
            Err(EbpfError::SycallAlreadyRegistered)
        } else {
            Ok(())
        }
    }
/// Register a syscall function by its symbol hash
Register a syscall function by its symbol hash
Register a syscall function by its symbol hash
pub fn register_syscall_by_hash<E: UserDefinedError, O: SyscallObject<E>>(
        &mut self,
        hash: u32,
        function: SyscallFunction<E, &mut O>,
    ) -> Result<(), EbpfError<E>> {
        let function = function as *const u8 as u64;
        let context_object_slot = self.entries.len();
        if self
            .entries
            .insert(
                hash,
                Syscall {
                    function,
                    context_object_slot,
                },
            )
            .is_some()
            || self
                .context_object_slots
                .insert(function, context_object_slot)
                .is_some()
        {
            Err(EbpfError::SycallAlreadyRegistered)
        } else {
            Ok(())
        }
    }
pub fn register_syscall_by_hash < E : UserDefinedError , O : SyscallObject < E > > ( & mut self , hash : u32 , function : SyscallFunction < E , & mut O > , ) -> Result < ( ) , EbpfError < E > > { let function = function as * const u8 as u64 ; let context_object_slot = self . entries . len ( ) ; if self . entries . insert ( hash , Syscall { function , context_object_slot , } , ) . is_some ( ) || self . context_object_slots . insert ( function , context_object_slot ) . is_some ( ) { Err ( EbpfError :: SycallAlreadyRegistered ) } else { Ok ( ( ) ) } }
Register a syscall function by its symbol hash
Register a syscall function by its symbol hash
&mut self
hash
u32
function
SyscallFunction<E, &mut O>