         
         self.init(rawValue: rawValue)
     }
-}+}
+


// MARK: - SwiftFoundation Types

extension SwiftFoundation.Null: BSONEncodable {
    
    public func toBSON() -> BSON.Value { return .Null }

    public init?(BSONValue: BSON.Value) {
        
        guard let value = BSONValue.rawValue as? Null else { return nil }
        
        self = value
    }
}

// MARK: Date

extension SwiftFoundation.Date: BSONEncodable {
    
    public func toBSON() -> BSON.Value { return .Date(self) }
}

extension SwiftFoundation.Date: BSONDecodable {
    
    public init?(BSONValue: BSON.Value) {
        
        guard let value = BSONValue.rawValue as? Date else { return nil }
        
        self = value
    }
