(* Generated by coq-of-rust *)
Require Import CoqOfRust.CoqOfRust.

Module extension.
  Module default_account_state.
    (* StructRecord
      {
        name := "DefaultAccountState";
        ty_params := [];
        fields := [ ("state", Ty.path "u8") ];
      } *)
    
    Module Impl_core_clone_Clone_for_spl_token_2022_extension_default_account_state_DefaultAccountState.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::default_account_state::DefaultAccountState".
      
      (* Clone *)
      Definition clone (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.match_operator (|
                Value.DeclaredButUndefined,
                [ fun γ => ltac:(M.monadic (M.read (| self |))) ]
              |)
            |)))
        | _, _ => M.impossible
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::clone::Clone"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method clone) ].
    End Impl_core_clone_Clone_for_spl_token_2022_extension_default_account_state_DefaultAccountState.
    
    Module Impl_core_marker_Copy_for_spl_token_2022_extension_default_account_state_DefaultAccountState.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::default_account_state::DefaultAccountState".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::marker::Copy"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_marker_Copy_for_spl_token_2022_extension_default_account_state_DefaultAccountState.
    
    Module Impl_core_fmt_Debug_for_spl_token_2022_extension_default_account_state_DefaultAccountState.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::default_account_state::DefaultAccountState".
      
      (* Debug *)
      Definition fmt (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [ self; f ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let f := M.alloc (| f |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.path "core::fmt::Formatter",
                "debug_struct_field1_finish",
                []
              |),
              [
                M.read (| f |);
                M.read (| Value.String "DefaultAccountState" |);
                M.read (| Value.String "state" |);
                (* Unsize *)
                M.pointer_coercion
                  (M.alloc (|
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "spl_token_2022::extension::default_account_state::DefaultAccountState",
                      "state"
                    |)
                  |))
              ]
            |)))
        | _, _ => M.impossible
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::fmt::Debug"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
    End Impl_core_fmt_Debug_for_spl_token_2022_extension_default_account_state_DefaultAccountState.
    
    Module Impl_core_default_Default_for_spl_token_2022_extension_default_account_state_DefaultAccountState.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::default_account_state::DefaultAccountState".
      
      (* Default *)
      Definition default (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [] =>
          ltac:(M.monadic
            (Value.StructRecord
              "spl_token_2022::extension::default_account_state::DefaultAccountState"
              [
                ("state",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::default::Default",
                      Ty.path "u8",
                      [],
                      "default",
                      []
                    |),
                    []
                  |))
              ]))
        | _, _ => M.impossible
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::default::Default"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("default", InstanceField.Method default) ].
    End Impl_core_default_Default_for_spl_token_2022_extension_default_account_state_DefaultAccountState.
    
    Module Impl_core_marker_StructuralPartialEq_for_spl_token_2022_extension_default_account_state_DefaultAccountState.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::default_account_state::DefaultAccountState".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::marker::StructuralPartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_marker_StructuralPartialEq_for_spl_token_2022_extension_default_account_state_DefaultAccountState.
    
    Module Impl_core_cmp_PartialEq_for_spl_token_2022_extension_default_account_state_DefaultAccountState.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::default_account_state::DefaultAccountState".
      
      (* PartialEq *)
      Definition eq (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [ self; other ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let other := M.alloc (| other |) in
            BinOp.Pure.eq
              (M.read (|
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "spl_token_2022::extension::default_account_state::DefaultAccountState",
                  "state"
                |)
              |))
              (M.read (|
                M.SubPointer.get_struct_record_field (|
                  M.read (| other |),
                  "spl_token_2022::extension::default_account_state::DefaultAccountState",
                  "state"
                |)
              |))))
        | _, _ => M.impossible
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::PartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("eq", InstanceField.Method eq) ].
    End Impl_core_cmp_PartialEq_for_spl_token_2022_extension_default_account_state_DefaultAccountState.
    
    Module Impl_bytemuck_pod_Pod_for_spl_token_2022_extension_default_account_state_DefaultAccountState.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::default_account_state::DefaultAccountState".
      
      Axiom Implements :
        M.IsTraitInstance
          "bytemuck::pod::Pod"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_bytemuck_pod_Pod_for_spl_token_2022_extension_default_account_state_DefaultAccountState.
    
    Module Impl_bytemuck_zeroable_Zeroable_for_spl_token_2022_extension_default_account_state_DefaultAccountState.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::default_account_state::DefaultAccountState".
      
      Axiom Implements :
        M.IsTraitInstance
          "bytemuck::zeroable::Zeroable"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_bytemuck_zeroable_Zeroable_for_spl_token_2022_extension_default_account_state_DefaultAccountState.
    
    Module Impl_spl_token_2022_extension_Extension_for_spl_token_2022_extension_default_account_state_DefaultAccountState.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::default_account_state::DefaultAccountState".
      
      (*     const TYPE: ExtensionType = ExtensionType::DefaultAccountState; *)
      (* Ty.path "spl_token_2022::extension::ExtensionType" *)
      Definition value_TYPE : Value.t :=
        M.run
          ltac:(M.monadic
            (M.alloc (|
              Value.StructTuple "spl_token_2022::extension::ExtensionType::DefaultAccountState" []
            |))).
      
      Axiom Implements :
        M.IsTraitInstance
          "spl_token_2022::extension::Extension"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("value_TYPE", InstanceField.Constant value_TYPE) ].
    End Impl_spl_token_2022_extension_Extension_for_spl_token_2022_extension_default_account_state_DefaultAccountState.
    
    Axiom PodAccountState :
      (Ty.path "spl_token_2022::extension::default_account_state::PodAccountState") =
        (Ty.path "u8").
  End default_account_state.
End extension.
