Class: Codify::Rust::Types::Option

Inherits:
Struct
  • Object
show all
Includes:
Codify::Rust::Type
Defined in:
lib/codify/rust/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Codify::Rust::Type

#defaultible?, #definition?, #each_subtype, #primitive?, #to_rust

Instance Attribute Details

#tObject

Returns the value of attribute t

Returns:

  • (Object)

    the current value of t



60
61
62
# File 'lib/codify/rust/types.rb', line 60

def t
  @t
end

Class Method Details

.to_sObject



63
# File 'lib/codify/rust/types.rb', line 63

def self.to_s() 'Codify::Rust::Types::Option' end

Instance Method Details

#flattenObject



68
69
70
# File 'lib/codify/rust/types.rb', line 68

def flatten
  t.is_a?(self.class) ? t : self
end

#to_sObject



66
# File 'lib/codify/rust/types.rb', line 66

def to_s() "Option<#{t}>" end

#typesObject



65
# File 'lib/codify/rust/types.rb', line 65

def types() [t] end