about summary refs log blame commit diff stats
path: root/src/types/buffersource.nim
blob: 97126ed1a73aa8cfe8b0fb74d3e5914779a6eceb (plain) (tree)
1
2
3
4
5
6
7
8
9
10




                    
                     

                

                      






                                           
                                






                             
import options

when defined(posix):
  import posix

import loader/request
import types/url

import chakasu/charset

type
  BufferSourceType* = enum
    CLONE, LOAD_REQUEST, LOAD_PIPE

  BufferSource* = object
    location*: URL
    contenttype*: Option[string] # override
    charset*: Charset # fallback
    case t*: BufferSourceType
    of CLONE:
      clonepid*: Pid
    of LOAD_REQUEST:
      request*: Request
    of LOAD_PIPE:
      fd*: FileHandle