pub fn init(
        data: &mut [u8],
        name: &ArrayString64,
        reference_type: ReferenceType,
    ) -> Result<(), ProgramError> {
        if RefDB::is_initialized(data) {
            return Err(ProgramError::AccountAlreadyInitialized);
        }
        let record_size = Record::NO_REF_LEN + reference_type.get_size();
        check_data_len(data, Header::LEN + record_size)?;
        let header = Header {
            counter: 1,
            active_records: 0,
            reference_type,
            name: *name,
        };
        header.pack(data)?;
        Ok(())
    }
/// Initializes the storage, must be called before first read/write
Initializes the storage, must be called before first read/write
Initializes the storage must be called before first read / write
pub fn init(
        data: &mut [u8],
        name: &ArrayString64,
        reference_type: ReferenceType,
    ) -> Result<(), ProgramError> {
        if RefDB::is_initialized(data) {
            return Err(ProgramError::AccountAlreadyInitialized);
        }
        let record_size = Record::NO_REF_LEN + reference_type.get_size();
        check_data_len(data, Header::LEN + record_size)?;
        let header = Header {
            counter: 1,
            active_records: 0,
            reference_type,
            name: *name,
        };
        header.pack(data)?;
        Ok(())
    }
pub fn init ( data : & mut [ u8 ] , name : & ArrayString64 , reference_type : ReferenceType , ) -> Result < ( ) , ProgramError > { if RefDB :: is_initialized ( data ) { return Err ( ProgramError :: AccountAlreadyInitialized ) ; } let record_size = Record :: NO_REF_LEN + reference_type . get_size ( ) ; check_data_len ( data , Header :: LEN + record_size ) ? ; let header = Header { counter : 1 , active_records : 0 , reference_type , name : * name , } ; header . pack ( data ) ? ; Ok ( ( ) ) }
Initializes the storage, must be called before first read/write
Initializes the storage must be called before first read / write
data
&mut [u8]
name
&ArrayString64
reference_type
ReferenceType
data
&mut [u8]
name
&ArrayString64
reference_type
ReferenceType