class_docstr: Column that stores fields of values.
  
  Every column has n children, where n is
  the number of fields in the Struct Dtype.
class_docstr_tok: ["Column","that","stores","fields","of","values",".","Every","column","has","n","children",",","where","n","is","the","number","of","fields","in","the","Struct","Dtype","."]
code: def _with_type_metadata(
      self: StructColumn, dtype: Dtype
  ) -> StructColumn:
      from cudf.core.column import IntervalColumn
      from cudf.core.dtypes import IntervalDtype
  
      # Check IntervalDtype first because it's a subclass of StructDtype
      if isinstance(dtype, IntervalDtype):
          return IntervalColumn.from_struct_column(
              self, closed=dtype.closed
          )
      elif isinstance(dtype, StructDtype):
          return build_struct_column(
              names=dtype.fields.keys(),
              children=tuple(
                  self.base_children[i]._with_type_metadata(
                      dtype.fields[f]
                  )
                  for i, f in enumerate(dtype.fields.keys())
              ),
              mask=self.base_mask,
              size=self.size,
              offset=self.offset,
              null_count=self.null_count,
          )
  
      return self
  
imports: from __future__ import annotations
  from functools import cached_property
  from typing import Optional
  import pandas
  import pyarrow
  import cudf
  from cudf._typing import Dtype
  from cudf.core.column import ColumnBase, build_struct_column
  from cudf.core.column.methods import ColumnMethods
  from cudf.core.dtypes import StructDtype
  from cudf.core.missing import NA
label_desc: Use image node_id 10 for calling the StructColumn obj's underlying member method code with example usage: obj._with_type_metadata(dtype) and returns: self, IntervalColumn, build_struct_column