Struct ilockmvp::ilockmvp::Port

source ·
pub struct Port {
    pub application: <<ILOCKmvp as ContractEnv>::Env as Environment>::Hash,
    pub tax: <<ILOCKmvp as ContractEnv>::Env as Environment>::Balance,
    pub cap: <<ILOCKmvp as ContractEnv>::Env as Environment>::Balance,
    pub locked: bool,
    pub paid: <<ILOCKmvp as ContractEnv>::Env as Environment>::Balance,
    pub collected: <<ILOCKmvp as ContractEnv>::Env as Environment>::Balance,
    pub owner: <<ILOCKmvp as ContractEnv>::Env as Environment>::AccountId,
}
Expand description
  • Information pertaining to port definition in application/socket/port contract connectivity formalism.

Fields§

§application: <<ILOCKmvp as ContractEnv>::Env as Environment>::Hash
  • What is the codehash of the application smart contract associated with this port?
  • This codehash is the application template that numerous individual application contracts may be instantiated and connected to this PSP22 contract via socket without signed permission from this ILOCK contract’s owner.
  • This codehash is essential to making sure that only safe and approved application contracts are able to connect to this token contract and manipulate its owneronly functionalities (as defined per respective port protocol).
§tax: <<ILOCKmvp as ContractEnv>::Env as Environment>::Balance
  • How much does Interlock tax transaction taking place within a port protocol’s socket call?
§cap: <<ILOCKmvp as ContractEnv>::Env as Environment>::Balance
  • For withdrawing rewards from ILOCK rewards pool, what is the max this particular port owner’s application type can withdraw from rewards pool?
§locked: bool
  • If locked, only Interlock token contract owner can create a socket connection with this token contract using the appropriate application codehash.
§paid: <<ILOCKmvp as ContractEnv>::Env as Environment>::Balance
  • How much ILOCK has this port been rewarded or issued throughout the course of its operation (in case where protocol rewards or issues ILOCK, that is)?
§collected: <<ILOCKmvp as ContractEnv>::Env as Environment>::Balance
  • How much has Interlock collected from this port in taxes or other collections?
§owner: <<ILOCKmvp as ContractEnv>::Env as Environment>::AccountId
  • Who is the overall owner of this port?
  • Socket operators are not necessarily owners of the port.
  • For example, a restaurant franchise has one owner, whereas the franchise may have numberous restaurant locations, each with it’s own operator, each operator/franchise pair forming a separate socket connection.

Trait Implementations§

source§

impl Clone for Port

source§

fn clone(&self) -> Port

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Port

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Port

source§

fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Self, Error>

Attempt to deserialise the value from input.
§

fn skip<I>(input: &mut I) -> Result<(), Error>where I: Input,

Attempt to skip the encoded value from input. Read more
§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
source§

impl Default for Port

  • Ink 4 has no AccountId Default impl thus struct Default cannot be derived due to owner field.
  • Default derivation is required by openbrush contract implementation of contract storage.
source§

fn default() -> Port

Returns the “default value” for a type. Read more
source§

impl Encode for Port

source§

fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )

Convert self to a slice and append it to the destination.
§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
§

fn encode(&self) -> Vec<u8, Global>

Convert self to an owned vector.
§

fn using_encoded<R, F>(&self, f: F) -> Rwhere F: FnOnce(&[u8]) -> R,

Convert self to a slice and then invoke the given closure with it.
§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
source§

impl PartialEq<Port> for Port

source§

fn eq(&self, other: &Port) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StorageLayout for Port

source§

fn layout(__key: &Key) -> Layout

Returns the static storage layout of Self. Read more
source§

impl TypeInfo for Port

§

type Identity = Port

The type identifying for which type info is provided. Read more
source§

fn type_info() -> Type

Returns the static type identifier for Self.
source§

impl EncodeLike<Port> for Port

source§

impl Eq for Port

source§

impl StructuralEq for Port

source§

impl StructuralPartialEq for Port

Auto Trait Implementations§

§

impl RefUnwindSafe for Port

§

impl Send for Port

§

impl Sync for Port

§

impl Unpin for Port

§

impl UnwindSafe for Port

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> DecodeAll for Twhere T: Decode,

§

fn decode_all(input: &mut &[u8]) -> Result<T, Error>

Decode Self and consume all of the given input data. Read more
§

impl<T> DecodeLimit for Twhere T: Decode,

§

fn decode_all_with_depth_limit( limit: u32, input: &mut &[u8] ) -> Result<T, Error>

Decode Self and consume all of the given input data. Read more
§

fn decode_with_depth_limit<I>(limit: u32, input: &mut I) -> Result<T, Error>where I: Input,

Decode Self with the given maximum recursion depth and advance input by the number of bytes consumed. Read more
§

impl<T> DefaultEnv for T

§

fn env() -> EnvAccess<'static, DefaultEnvironment>

§

impl<T> Flush for Twhere T: Storable + StorageKey,

§

fn flush(&self)

Method flushes the current state of Self into storage. ink! recursively calculate a key of each field. So if you want to flush the correct state of the contract, you have to this method on storage struct.
§

fn load(&mut self)

Method loads the current state of Self from storage. ink! recursively calculate a key of each field. So if you want to load the correct state of the contract, you have to this method on storage struct.
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> KeyedVec for Twhere T: Codec,

§

fn to_keyed_vec(&self, prepend_key: &[u8]) -> Vec<u8, Global>

Return an encoding of Self prepended by given slice.
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<P> Storable for Pwhere P: Codec,

§

fn encode<T>(&self, dest: &mut T)where T: Output + ?Sized,

Convert self to a slice and append it to the destination.
§

fn decode<I>(input: &mut I) -> Result<P, Error>where I: Input,

Attempt to deserialize the value from input.
§

impl<P, Key> StorableHint<Key> for Pwhere P: Packed, Key: StorageKey,

§

type Type = P

Storable type with storage key inside.
§

type PreferredKey = AutoKey

The storage key that the type prefers. It can be overwritten by an auto-generated storage key.
§

impl<T> StorageAsMut for Twhere T: StorageAsRef,

§

fn data<Data>(&mut self) -> &mut Datawhere Data: OccupyStorage, Self: Storage<Data>,

§

impl<T> StorageAsRef for T

§

fn data<Data>(&self) -> &Datawhere Data: OccupyStorage, Self: Storage<Data>,

§

impl<P> StorageKey for Pwhere P: Packed,

§

const KEY: u32 = 0u32

Storage key of the type.
§

fn key(&self) -> u32

Returns the storage key.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<S> Codec for Swhere S: Decode + Encode,

§

impl<T> EncodeLike<&&T> for Twhere T: Encode,

§

impl<T> EncodeLike<&T> for Twhere T: Encode,

§

impl<T> EncodeLike<&mut T> for Twhere T: Encode,

§

impl<T> EncodeLike<Arc<T>> for Twhere T: Encode,

§

impl<T> EncodeLike<Box<T, Global>> for Twhere T: Encode,

§

impl<'a, T> EncodeLike<Cow<'a, T>> for Twhere T: ToOwned + Encode,

§

impl<T> EncodeLike<Rc<T>> for Twhere T: Encode,

§

impl<S> FullCodec for Swhere S: Decode + FullEncode,

§

impl<S> FullEncode for Swhere S: Encode + EncodeLike<S>,

§

impl<T> JsonSchemaMaybe for T

§

impl<P> Packed for Pwhere P: Decode + Encode,

§

impl<T> StaticTypeInfo for Twhere T: TypeInfo + 'static,