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

                    
                  
 
                     

                

                      





                                  
                                           
                                






                             
import std/options

when defined(posix):
  import std/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