Module: Codify::Rust::Type

Instance Method Summary collapse

Instance Method Details

#defaultible?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/codify/rust/type.rb', line 19

def defaultible?
  self.primitive?
end

#definition?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/codify/rust/type.rb', line 23

def definition?
  Codify::Rust::Definition === self
end

#each_subtype(&block) ⇒ void

This method returns an undefined value.



35
36
37
38
39
40
41
# File 'lib/codify/rust/type.rb', line 35

def each_subtype(&block)
  self.types.each do |subtype|
    raise RuntimeError, subtype.inspect unless subtype.is_a?(Codify::Rust::Type)
    block.call(subtype) if block_given?
    subtype.each_subtype(&block)
  end
end

#primitive?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/codify/rust/type.rb', line 13

def primitive?
  true
end

#to_rustObject



7
8
9
# File 'lib/codify/rust/type.rb', line 7

def to_rust
  self
end

#typesArray<Type>

Returns:



29
30
31
# File 'lib/codify/rust/type.rb', line 29

def types()
  []
end